I am unable to include stdio.h in the kernel code.
It shows the following error during compilation of kernel code:
FYI, Visual Studio 2008 was used for development.
Program failed to build.
Device 0 Build Log:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\crt\src\crtdefs.h(36): cat
astrophic error:
#error directive: ERROR: Use of C runtime library internal header
file.
#error ERROR: Use of C runtime library internal header file.
^
1 catastrophic error detected in the compilation of "C:\Users\mine\AppData\Local
\Temp\OCL69AB.tmp.cl".
Compilation terminated.
ing=1 -D
I know that the OpenCL version of printf() can be used but I need to use other functions in stdio.h as well.
The kernel code is attached herewith.
#include<stdio.h> __kernel void vecadd(__global int *A, __global int *B, __global int *C, ) { int idx = get_global_id(0); C[idx] = A[idx] - B[idx]; printf("\n%d",C[idx]); }