Is it possible to perform a bitwise xor, and, or on a __global uint * pointer in OpenCL? I’m trying to do this but compiler throws me an error.
The goal is to perform something like:
__global uint *p = an address on global memory
then
*p = some value
*(p ^ 1) = other value
In C we can manipulate pointers freely - can it be done on OpenCL?
Why not share the error the compiler threw? It would be helpful. Was it that “1” isn’t the same type as “p”? If so, perhaps *(p ^ (__global uint *)1) would work. If not, try casting the pointer to an unsigned integer of the same width, then doing your bitops there, and then casting back.