bubu

const sampler

Discussion created by bubu on Jun 11, 2010
Latest reply on Jun 12, 2010 by 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.

Outcomes