Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Eclipse to recognize automatic CUDA kernel variables and functions

Tags:

eclipse

cuda

Is there a way to get Eclipse (Indigo) to know about the built-in variables and functions that are available to CUDA kernels?

Consider the following simple kernel

__global__ void myKernel()
{
    int x = threadIdx.x;
    __syncthreads();
}

The Eclipse IDE highlights "threadIdx" and "__syncthreads" with a "Symbol 'the built-in symbol' could not be resolved" error message. Is there a way to tell Eclipse these are actually implicitly defined?

like image 283
Mr Fooz Avatar asked Feb 13 '26 17:02

Mr Fooz


1 Answers

flipchart is correct. #include <cuda_runtime_api.h> does the trick if the symbol __CUDACC__ is defined beforehand.

like image 134
Mr Fooz Avatar answered Feb 16 '26 09:02

Mr Fooz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!