Results 1 to 3 of 3

Thread: How to read a clCreateImage3D

  1. #1
    Junior Member
    Join Date
    Aug 2011
    Posts
    2

    How to read a clCreateImage3D

    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?

    Code :
    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

  2. #2

    Re: How to read a clCreateImage3D

    Try using clEnqueueReadImage instead

  3. #3
    Junior Member
    Join Date
    Aug 2011
    Posts
    2

    Re: How to read a clCreateImage3D

    Perfect! Thanks

Similar Threads

  1. Replies: 3
    Last Post: 06-16-2011, 03:44 AM
  2. please..read this..and help me...-0-
    By Ulimit77 in forum OpenGL ES general technical discussions
    Replies: 2
    Last Post: 05-16-2005, 07:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •