Hello,
I have managed to create a 3D image without any errors and now need to read it out after the kernal has executed. My question is how this is done?
cl_image_format volume_format;
volume_format.image_channel_order = CL_INTENSITY;
volume_format.image_channel_data_type =CL_FLOAT;
d_volumeArray = clCreateImage3D(context, CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR /* CL_MEM_COPY_HOST_PTR*/, &volume_format,
CubeWidth, CubeHeight, CubeDepth,
(CubeWidth*4), (CubeWidth*CubeHeight*4),
Cube, &status);
.....Do Stuff.....
///here is the problem
status = clEnqueueReadBuffer(
commandQueue,
d_volumeArray,
CL_TRUE,
0,
(CubeWidth*CubeHeight*4),
Cube,
0,
NULL,
&events[1]);
It gives this error:
clEnqueueReadBuffer failed. Error code : CL_INVALID_MEM_OBJECT
any help is appreciated