View Full Version : include headers to OpenCL .cl file

01-24-2013, 07:09 AM
I"ve written an OpenCL kernel in .cl file, it has several include files (.h) . The compilation of it fails ,since the included header files are "not found". I am aware that in the clBuildProgram exists the option -I dir ,which adds the directory dir to the list of directories to be searched for the header files. In the khronus site forum this post http://www.khronos.org/message_boards/viewtopic.php?f=37&t=2535 talks about the issue. They propose to use clCreateProgramWithSource which specifies all sources (including .h files). I have a questions regarding this issue:

1.Which option is better?(clBuildProgram vs. clCreateProgramWithSource,as described above)
2.If I use clCreateProgramWithSource how is it known for compiler what to include?I mean which source stands for which include file name?
3.If I use clBuildProgram and there are several directories with include files?How do I specify them?