Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversions from float to integers fail #48

Open
cdsousa opened this issue Dec 7, 2020 · 1 comment
Open

Conversions from float to integers fail #48

cdsousa opened this issue Dec 7, 2020 · 1 comment
Labels
bug Something isn't working kernels Things about kernels and how they are compiled.

Comments

@cdsousa
Copy link

cdsousa commented Dec 7, 2020

For example, this:

Int32.(ceil.(oneAPI.oneArray([1.2f0])))

fails with Reason: unsupported call to an unknown function (call to gpu_malloc)

As @maleadt said, the reason is:

we don't have a device-side malloc right now, which breaks exceptions that box their arguments

@cdsousa
Copy link
Author

cdsousa commented Dec 7, 2020

I notice that this works:

oneapi_intceil(x) = oneAPI.@builtin_ccall("convert_int_rtp", Cint, (Float32,), x)
oneapi_intceil.(oneAPI.oneArray([1.2f0])  

Maybe, in order to solve well-behaved conversions with rounding modes it is just a matter of defining oneAPI.ceil(::Type{Int32}, x) and similar functions, and then have JuliaGPU/GPUCompiler.jl#112 fixed.

@maleadt maleadt added bug Something isn't working kernels Things about kernels and how they are compiled. labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kernels Things about kernels and how they are compiled.
Projects
None yet
Development

No branches or pull requests

2 participants