3 Replies Latest reply on May 28, 2013 12:39 AM by himanshu.gautam

    layered texture and opencl

    sajis997

      Hi forum,

       

      A one or two dimensional layered texture is a texture made up of sequence of layers, all of which are regular textures of same dimensionality, size and data type.

       

      How to create layered texture in OpenCL ?

       

      Regards

      Sajjadul

        • Re: layered texture and opencl
          himanshu.gautam

          Not very sure about the question here. But probably you can look in 3D cl_images using clCreateImage API in the OpenCL spec.

            • Re: layered texture and opencl
              sajis997

              Ok Guys, Please do not get mad as i am bringing the reference of CUDA here. I started to learn about GPGPU programming with CUDA and trying to map the issues here in OpenCL.

               

              In CUDA there are two types of device memory , linear memory and CUDA arrays.

               

              1. Linear Memory - used for normal data. This is the region of consecutive addresses in device memory. And they are accessed via pointers

                

              2. CUDA array - used for textures.

               

              In  OpenCL , device memory is also categorized in the same manner i guess.

               

              1. Linear memory created with clCreateBuffer().

               

              2. For texturing operation we use clCreateImage2D()/clCreateImage3D().

               

              Now 3D are to be represented in the linear manner as follows :

               

              char *buffer = new char[width * height * depth *4];

               

              What to use there clCreateBuffer or clCreateImage3D() ?

               

              The same questions applies in the 2D case as well. 

               

              I think if there is no texturing operation involved then stay with clCreateBuffer instead. What do you think ?

               

              The confusion arises because CUDA provides support for 3D object to be represented in a linear manner with cudaMalloc3D().

               

              Looking forward to you feedback over this issue.

               

               

              Thanks

              Sajjadul