i have implemented project opencl. have file contains kernel function , functions used kernel included in seperate header file when change file included, changes applied , not , makes me confused if application has bug or not.
i checked other posts in stackoverflow , see nvidia has serious problem passing -i{include directory}, changed , give header files address explicitly, still opencl compiler not able find errors in header file included in kernel file name.
also, using nvidia gtx 980 , have intalled cuda 7.0 on computer.
anyone has same experience? how can fix it?
so, assume have kernel 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 test_kernel_include.cl follows:
int test_func() { return 1; } then run code , array members equal 1 expect. now, change test_kernel_include.cl to:
int test_func() { return 2; } but result still array members equal 1 should change 2 not.
in order improve kernel compilation times, nvidia implement caching scheme, whereby compiled kernel binary stored disk , loaded next time same kernel compiled. hash computed on kernel source code used index compiled kernel cache.
unfortunately, these hashes not include header files included main kernel source. means when change in included header file, driver ignore change , reload previous kernel binary disk (unless changed in main kernel source well).
on linux systems, kernel cache can found in ~/.nv/computecache. if delete directory after making change 1 of include files, should force driver recompile opencl kernel.
Comments
Post a Comment