- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
/* 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);
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page