AnsweredAssumed Answered

clBuildProgram crash

Question asked by msqrt on Mar 4, 2014
Latest reply on Jun 18, 2014 by pinform

This kernel runs fine on my computer on a CPU device and the CodeXL Kernel Analyzer verifies it should work on a wide variety of cards - everything HD5k or newer for image support. I'm unfortunately currently stuck with a HD4870 and therefore cannot test it myself. On my roommates computer, however, clBuildProgram reports an unexpected exception, both in my own host application and the Kernel Analyzer. We installed new drivers, the APP SDK and CodeXL but nothing seems to work. Is this a driver bug or is the code actually somehow wrong?



typedef struct {
float4 orig;
float4 dir;
} CLRay;

typedef struct {
float2 uv;
float t;
int id;
} CLResult;

typedef struct {
float4 a1, a2, a3;
} CLTriangle;

typedef struct {
float4 nor, col;
} CLTriangledata;

kernel void fill_image( image2d_t img,
constant CLRay * ray,
constant CLResult * result,
global CLTriangledata * triangledata,
float N) {
const int2 id = (int2){get_global_id(0), get_global_id(1)};
const int id1d = id.y*get_global_size(0)+id.x;
int res = result[id1d].id;
float4 col = (float4).0f;
col = pow(triangledata[res].col, 2.2f) * fabs(dot(ray[id1d].dir, triangledata[res].nor));
float4 oldcol = read_imagef(img, sampler, id);
write_imagef(img, id, (oldcol*(N-1.0f)+col)/N);