Convert related kernels errors with CUDAKernels
Created by: mloubout
kernels involving convert
error due to call to julia runtime in the GPU case (runs fine on CPU). Here is an MFE
using CUDA, KernelAbstractions, CUDAKernels
@kernel function myceil(x, y)
I = @index(Global)
@inbounds x[I] = ceil(Int, y[I])
end
@kernel function basiconvert(x, y)
I = @index(Global)
@inbounds x[I] = convert(Int, y[I])
end
ker_ceil = myceil(CUDADevice(), 8)
ker_convert = basiconvert(CUDADevice(), 8)
x = CUDA.ones(Int, 111)
y = CUDA.randn(111)
z = cu(Vector{Float32}(1:111))
ker_ceil(x, y, ndrange=length(x))
ker_convert(x, z, ndrange=length(x))
Versions: julia : 1.6.1 KernelAbstractions: 0.7.0 CUDA : 3.4.2 CUDAKernels : 0.3.0