cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

bubu
Adept II

const sampler

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.

0 Likes
2 Replies
LeeHowes
Staff

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.

0 Likes

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 !

0 Likes