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 :

K20:

errNum:-11

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

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

              ^

  buildLog ends here

R9:

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

          "../include/global.h"

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

                                ^

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

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!!!

 

Outcomes