I have some code like this:


buffer = clCreateBuffer( ... );
...
float* temp = new float[ size ];
...
clEnqueueWriteBuffer( ..., temp, ... );

clEnqueueBarrier( cq );