CL_INVALID_MEM_OBJECT error in clEnqueueReadBuffer

errcode = clEnqueueReadBuffer(clCPUCommandQue, ptrout_mem_objGPU, CL_TRUE, readoffsetGPU, readsizeGPU, ptrout + (int)splittingPoint * DIM_LOCAL_WORK_GROUP_Y * ncols, 0, NULL, NULL);
if(errcode != CL_SUCCESS) printf("##Error in reading GPU mem
");

clEnqueueReadBuffer throws CL_INVALID_MEM_OBJECT error. I am not able to find any solution to this.

According to the documentation, the mem. object should have been undeclared. but, it has been declared.

Could someone help me in this?

[QUOTE=mohitu;43966]clEnqueueReadBuffer throws CL_INVALID_MEM_OBJECT error. I am not able to find any solution to this.
[/QUOTE]

Could you please include:

  • Which device and driver/implementation version are you running on?
  • What arguments are you passing when the buffer is created?

It’d be great if you could include (snippets of) a log generated by the Intercept Layer for OpenCL Applications with CLInfoLogging and CallLogging enabled, but code snippets could work also:

https://github.com/intel/opencl-intercept-layer/blob/master/docs/controls.md#clinfologging-bool
https://github.com/intel/opencl-intercept-layer/blob/master/docs/controls.md#calllogging-bool