If I’m using restricted pointers and do something like this, am I violating the strict aliasing required to ensure proper behavior of restricted pointers?
void my_kernel(int const* __restrict__ data)
int const* data_offset = data + 3;
/* ... */
restrict is a promise the programmer makes to the compiler: Within the scope of the variable declaration, access to a data object is restricted to this particular pointer, there is no other path through which the same data is accessed (either via a different pointer argument, or as global data).
The compiler generates code based on the assumption that the promise is kept; if the programmer does not keep the promise, the behavior of the resulting code is undefined. This may not immediately cause an error in program behavior, the code may “happen to” work.
Your offset computation does not violate the promise given with restrict, unless adding the offset is a sneaky way to gain access to a different data object which is also accessed within the scope of “data” (meaning data_offset is aliased to that other object).