AnsweredAssumed Answered

How to include header files in kernel files?

Question asked by winston on Jun 28, 2015

I having troubles including header files in kernel files! i am sure that we can use "#include "xx.h"" in .cl files, before that we should set option in function "clBuiltProgram(.....)".such as clBuildProgram(program, 0, NULL, "-I ../include", NULL, NULL).But it does't work at all! For AMD APP ADK 2.9.1 on R9 and cuda_5.5 on k20,I always get the same result :



:2:10: fatal error:'../include/global.h' file not found

#include "../include/global.h"


  buildLog ends here


"/tmp/", line 2: catastrophic error: cannot open source file


  #include "../include/global.h"


1 catastrophic error detected in the compilation of "/tmp/".

Compilation terminated.


But it is strange that it works very fine even without setting the-I ../include option to  function "clBuiltProgram(.....)" in TITAN X with cuda_7.0.

Since there are so many head files to be included,i must solve the problem! Is there anybody can help me ? Thaks very much!!!