get_global_id() is a built-in of OpenCL C, so it is only defined inside of kernels. Are you trying to use it in host code? please post a minimal buildable example showing the problem.
I’ve tried to change “__kernel” to “global”, since “__kernel” is also not recognized but I had no success.
Actually I just wanted to use OpenCL instead of using CUDA. I’m using the CUDA SDK due to my GPU (NVIDIA GeForce GT630M). But it seems that there are some OpenCL types/functions in the CUDA SDK. But I was not able to find the function get_global_id (or “__kernel”).
OpenCL source files usually end in “.cl” (.cu is used by CUDA). But no, .cl files contain the source code.
To get a kernel first create a cl_program object with clCreateProgramWithSource(), next build the program with clBuildProgram(), and then create the kernel object with clCreateKernel().