oneAPI.jl
oneAPI.jl copied to clipboard
Conversions from float to integers fail
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
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.