oneAPI.jl icon indicating copy to clipboard operation
oneAPI.jl copied to clipboard

Conversions from float to integers fail

Open cdsousa opened this issue 5 years ago • 1 comments

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 avatar Dec 07 '20 10:12 cdsousa

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 https://github.com/JuliaGPU/GPUCompiler.jl/issues/112 fixed.

cdsousa avatar Dec 07 '20 15:12 cdsousa