I have implemented a project with opencl. I have a file which contains the kernel function and the functions which are used by the kernel are included in a seperate header file but when I change the file which is included, sometimes the changes are applied and sometimes they are not and it makes me confused if the application has bug or not.
I checked the other posts in stackoverflow and see nvidia has serious problem with passing -I{include directory}
, so I changed it and give the header files address explicitly, but still the opencl compiler is not able to find the errors in the header file which is included in the kernel file name.
Also, I am using nvidia gtx 980 and I have intalled CUDA 7.0 on my computer.
Anyone has the same experience? how can I fix it?
So, Assume I have a kernel like this:
#include "../../src/cl/test_kernel_include.cl"
void __kernel test_kernel(
__global int* result,
int n
)
{
int thread_idx = get_global_id(0);
result[thread_idx] = test_func();
}
which the test_kernel_include.cl
is as follows:
int test_func()
{
return 1;
}
Then I run the code and I get an array which all the members are equal to 1
as we expect. Now, I change the test_kernel_include.cl
to:
int test_func()
{
return 2;
}
but the result is still an array which all the members are equal to 1
which should change to 2
but they are not.