3 Replies Latest reply on Jul 24, 2012 10:34 AM by LeeHowes

    Problem using OpenCL Image3D

    abhinav.golas

      I'm trying to create and use a 3D image in OpenCL, using the C++ extensions. I have the latest APP SDK, running on a Radeon HD 6870. I use the following command to create an image at the host end:

      var = cl::Image3D(context, CL_MEM_READ_ONLY | CL_MEM_HOST_NO_ACCESS | CL_MEM_COPY_HOST_PTR, cl::ImageFormat(CL_R, CL_FLOAT), static_cast<size_t>(m), static_cast<size_t>(n), static_cast<size_t>(o), static_cast<size_t>(0u), static_cast<size_t>(0u), (void*)data, &err);

       

      where m=n=o=102. The data pointer is a float* of size m*n*o exactly. However, when at the kernel end, I query the image size using get_image_dim or get_image_{depth,height,width} I get a value of 1 for the depth. I've verified this by looking at the interpolated values returned by read_imagef that it is not accessing all of the data. The image var is passed to the kernel as "read_only image3d_t ...".

       

      I checked that, as expected, the card supports images with a maximum size of 2048 along any dimension.

       

      Can anyone advise on the possible causes and corrections?