cl_mem a=clCreateBuffer(clGPUContext, CL_MEM_READ_WRITE, sizeof(double)*100, NULL, &errcode);
errcode = clEnqueueWriteBuffer(clCommandQue, a, CL_FALSE, 0, sizeof(double)*100, temp, 0, NULL, NULL);
I got error by doing this.
sorry, it is working now. The error was caused the the other problem.
But do I need release both of them? Or just release a? Thanks!
no just once. under the hood all cl_* objects are just pointer to some struct. you should call clRetain on object if you want copy cl object handler somewhere else. for example when you pass cl_mem into some fucntion and want ensure that object remain valid whole time.
Retrieving data ...