I have a question regarding the following :
Lets say i would do something like this inside my kernel
int *ptr = &global[tid]; ptr = 23; ptr = 0; instead of just global[tid] = 23; global[tid+1] = 0
My question is :
Would the int *ptr = &global[tid] considered to be an memory read or is it possible for the compiler optimize the two code parts be the same?