force variable in global mem


how can I force a variable to be in global memory? In CUDA I can use the __local keyword but in OpenCL I cannot use __global as variable’s modifier.

I need something like this:

register float4 varReg;

__global float4 varMem;

varReg.x += 1.0f;

varMem.x += 1.0f;

The idea is to reduce the register pressure. I barely update the “varMem” variable, so it could be stored in global memory.

On the other hand, you should allow to use the C “register” keyword to make the oposite.

Yes, the compiler need this kind of human help to make the things right !