Kernel Compilation error- KernelError: recursion is currently not supported

But this code wouldn’t even work on the CPU?

julia> format = fill(0, (10,10,5));
julia> lab_image = fill(128, (10,10,3))
julia> i = 1; j = 2
julia> format[i, j] = [(lab_image[i][j][0]), (lab_image[i][j][1]), (lab_image[i][j][2]), i, j]
ERROR: BoundsError

Before even considering GPU execution: there’s plenty wrong with this, you can’t do format[i,j] but need to slice, lab_image[i][j][0] is 0 indexed, it should also be lab_image[i,j,1], you want to do element-wise assignment, etc. Please make sure your code works first before trying to port it to the GPU, a pretty unfriendly environment where errors are much harder to debug. And again, you probably don’t need custom kernels at all, try working with array abstractions (which you can first develop on Array, and then port to CuArray).