Bitwise operator "&" won't work in kernel functions

Hi everyone,

CUDA does not have an intrinsic function to operate “&”. However, in c/c++ you can still use the intrinsic bitwise __and() to get the same result in your kernel method, or in python for example by cupy you can this.
In Julia, it is not possible to does bitwise “&” in kernel functions, So no CUDA version and no Julia version. Any idea? Suggestion?

Are you sure it doesn’t just work already?

using CUDA
x = CuArray(rand(Bool, 10, 10))
y = CuArray(rand(Bool, 10, 10))
x .& y

Gives me:

julia> x .& y
10×10 CuArray{Bool, 2, CUDA.Mem.DeviceBuffer}:
 0  0  0  0  0  0  1  1  0  0
 0  0  0  0  0  1  0  1  1  0
 1  0  0  1  0  0  0  0  0  0
 1  0  0  0  0  1  0  1  0  0
 0  0  1  0  0  1  0  0  0  0
 0  1  1  0  1  0  0  0  1  0
 0  0  0  0  0  1  0  0  0  0
 1  0  0  1  0  1  1  1  1  0
 0  0  0  0  0  0  0  0  0  0
 1  1  0  0  1  0  0  1  1  0
4 Likes

Actually it works, Thank you very much.