cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

vcrobe
Journeyman III

Error in pointer arithmetic

Can someone explain me why this code doesn't work?

When I try to read the value of currentPosition after the increment I get the same result as when I don't do the arithmetic.

Why is this happening?

Thank you.



__kernel void foo(__global const void* a) { __global const uchar* currentPosition = (__global uchar*) a; // Update the position currentPosition += 4; }

0 Likes
1 Reply
vcrobe
Journeyman III

Sorry guys I found the error. It's about the alignment in the float3.

The arithmetic is working well.

I'm a newbie in OpenCL. Sorry

0 Likes