I am currently trying to build kernel with a header. I use clBuildProgram and include various directories in the options parameter.
After going through several headers, the OpenCL compiler reaches the following error:
Fail to build the program
“/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stdarg.h”, line 40
identifier “__builtin_va_list” is undefined
typedef __builtin_va_list __gnuc_va_list;
Something you are #include’ing is trying to #include stdarg.h, which is likely not compatible with OpenCL C99. Check your includes (and their includes) to find the culprit.
I suspected as much. I read somewhere that the OpenCL compiler had troubles with system header files, but I was hoping a second opinion would prove me wrong. I am using OpenCL 1.2, but is it safe to assume that it doesn’t work for later versions as well?
Of course. For example, and system header that includes file system access, system clock access, stdio access, etc. None of these can be accessed from the device.