Mr Fooz
Mr Fooz

Reputation: 111976

Getting Eclipse to recognize automatic CUDA kernel variables and functions

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?

Upvotes: 3

Views: 1406

Answers (2)

Uriel
Uriel

Reputation: 31

In cuda 11.3 you can add:

#include <device_launch_parameters.h>

Upvotes: 2

Mr Fooz
Mr Fooz

Reputation: 111976

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

Upvotes: 2

Related Questions