Compilation error with type-converting round functions, e.g., ceil(Int32, 1.2f0)
Created by: cdsousa
Some time ago, CUDA.jl won't work with calls to rounding functions that perform conversion to integer types. Currently, it already works (I don't know why since those versions are still not defined https://github.com/JuliaGPU/CUDA.jl/blob/4c9a03d6202afe816707ccd12ed22acfa65a3df5/src/device/intrinsics/math.jl#L243)
However, KernelAbstractions.jl still doesn't work, but instead it gives a seemingly unrelated error:
using CUDA
using KernelAbstractions
x_d = CUDA.cu(rand(Float32, 1))
y_d = CUDA.zeros(Int32, 1)
f(x::Float32) = ceil(Int32, x)
## CUDA
function cu!(y, x)
y[1] = f(x[1])
return nothing
end
y_d .= 0
@cuda cu!(y_d, x_d)
y_d
## KA
function main(y_d)
@kernel function ka!(y, x)
y[1] = f(x[1])
end
event = ka!(CUDAKernels.CUDADevice(), 1)(y_d, x_d, ndrange=(1,))
wait(event)
end
y_d .= 0
main(y_d)
y_d