OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1719 Discussions

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

av610h
Beginner
390 Views
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) {

printf(

"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);

}

0 Kudos
1 Reply
Doron_S_Intel
Employee
391 Views
Hello,

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.

Thanks,
Doron Singer
0 Kudos
Reply