build err for image2d_t on 1.5 (orks well on alpha-release before)

build err for image2d_t on 1.5 (orks well on alpha-release before)

It works well before when I was using Intel OpenCL SDK alpha-release --after I install the 1.5 release, it fails at

/* I am suspecting the image2d_t causethe problem -- since all other CL code works fine after upgrade to 1.5 */

ciErr1 = clBuildProgram(cpProgram, 0, NULL, NULL, NULL, NULL);

if (ciErr1 != CL_SUCCESS) {


"ERROR: Failed to build program...\\n");

return; }

my Cl-code:

constant float dwt_haar = 23170*23170./(1<<30);

__kernel __attribute__((vec_type_hint(float4)))

void fdwt_haar(__global const unsigned char* in, int width, __write_only __global image2d_t out)


int globalID = get_global_id(0);

int y=globalID/width;

int x=globalID- y*width;

int output_location = globalID;

float4 fdwt;

int input_location = y*width*4+x*2;

unsigned char P0 = in[input_location++];

unsigned char P1 = in[input_location--]; input_location +=width*2;

unsigned char P2 = in[input_location++];

unsigned char P3 = in[input_location];

fdwt.x= (P0+P1+P2+P3)*dwt_haar;

fdwt.y= (P0-P1+P2-P3)*dwt_haar;

fdwt.z= (P0+P1-P2-P3)*dwt_haar;

fdwt.w= (P0-P1-P2+P3)*dwt_haar;

write_imagef(out, (int2)(x,y), fdwt);


2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.


You can use the Offline Compiler we ship with our SDK to check your CL code for problems. In this case, it seems the problem is that you qualify the image2d_t with an address-space qualifier (__global), but address-space qualifiers only apply to pointers.
The compiler was improved between the previous version and this one, and is now more strict. This seems like a result of that.

Doron Singer

Leave a Comment

Please sign in to add a comment. Not a member? Join today