The following OpenCL kernel code don't do nothing, but it crash on clBuildProgram if i try to compile on GPU (no problem on CPU). May be the following code is wrong for a GPU, but a compiler that crash without a message is not a good idea
Testing the code is simple, add the following code into an example, so the code is not used but compiled, i had used TemplateC, be sure to use a GPU context ( TemplateC use CPU as default setting, change it )
PS it crash also if you compile only one kernel, on call3 there are 2 equal for , if you comment one of the the crash disappear
I am on linux Ubuntu 9.04
int call3(__global int * i1, __global int * i2)
{
for (int i = 0 ; i < 16 ; i++)
{
if (i1 != i2)
return -1;
}
for (int i = 0 ; i < 16 ; i++)
{
if (i1 != i2)
return -1;
}
return 1;
}
int call2(__global int * i1 , __global int * i2)
{
for (int i = 0 ; i < 16; i++)
{
if (call3(&i1[0],&i2[0]) == 1)
return 1;
}
return -1;
}
__kernel void call1(__global int * o1,
__global int * i1,
__global int * i2)
{
__private int globID = 0;
globID = get_global_id(0);
call2(&i1[0],&i2[0]);
o1[globID] = 0;
}