2 Replies Latest reply on Jun 12, 2010 12:24 AM by bubu

    const sampler

    bubu

      From the OpenCL spec 1.0.48:

       

      Samplers can also be declared as global constants in the program source using the following
      syntax.
      const sampler_t <sampler name> = <value>

       

      Nice but...

       

      const sampler_t imgSamplerInt2 = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_NONE | CLK_FILTER_NEAREST; 

       

      breaks the ATI's implementation with this message:

      Line 1: error: global variable must be declared in
                addrSpace constant
        const sampler_t imgSamplerInt2 = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_NONE | CLK_FILTER_NEAREST; 

       

      if I change the "const" by "__constant" then works...

       

      Pls, fix it or correct the spec.

        • const sampler
          LeeHowes

          This is an error in the spec. As other vendors have supported code with the error we will do so also in (I think) the next release. The spec may or may not be fixed, I can't really say what Khronos will decide on that.

            • const sampler
              bubu

               

              Originally posted by: LeeHowes This is an error in the spec. As other vendors have supported code with the error we will do so also in (I think) the next release. The spec may or may not be fixed, I can't really say what Khronos will decide on that.

               

              Ok thanks !