by sebraa » Mon May 15, 2017 6:55 pm
As far as I am aware, the core never automatically copies data from shared memory to local memory or back. You need to handle that yourself.
Data can be located in shared memory, local memory or CPU registers.
The CPU can only work (add, subtract, multiply...) with values in the registers,
but in C code, you don't use them directly. The compiler will take care of it.
So when you add two variables in shared memory, they will be copied to the CPU registers,
added, then written back to shared memory. Local memory is not involved in this case.