I have a few questions about the way we must handle the 'CL buffer'.
I create a buffer with 'clCreateBuffer' the use it. Then I use it several times in a loop, something like this
cl_mem buffer = clCreateBuffer(...)
for(int i=0; i < 1000; i++)
Question 1 : Does my buffer is sent each time from CPU memory to GPU memory, or only once ?
After I need to changes some informations in the buffer, then I do the following :
queue->Finish(); // Insure that the CL commands are completed !
delete buffer; // Release the buffer
1) Does 'queue->Finish()' is enough to complete the OpenCL command ?
2) Should I use 'delete' or clReleaseMemObject ?
3) Then I must call 'buffer = clCreateBuffer(...)' and also 'kernel->setArg(4, buffer);' to set up the new buffer ?
it should be send just once. but it is not guaranteed that it stay on the GPU. driver it can swap off from it. and you can not be sure that it stay.