Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get VS 2010 to recognize certain CUDA functions

At the moment CUDA already recognizes a key CUDA C/C++ function such as cudaMalloc, cudaFree, cudaEventCreate, etc.

It also recognizes certain types like dim3 and cudaEvent_t.

However, it doesn't recognize other functions and types such as the texture template, the __syncthreads functions, or the atomicCAS function.

Everything compiles just fine, but I'm tired of seeing red underlinings all over the place and I want to the see the example parameters displayed when you type in any recognizable function.

How do I get VS to catch these functions?

like image 792
sj755 Avatar asked May 30 '11 20:05

sj755


Video Answer


1 Answers

You could create a dummy #include file of the following form:

#pragma once
#ifdef __INTELLISENSE__
void __syncthreads();
...
#endif

This should hide the fake prototypes from the CUDA and Visual C++ compilers, but still make them visible to IntelliSense.

Source for __INTELLISENSE__ macro: http://blogs.msdn.com/b/vcblog/archive/2011/03/29/10146895.aspx

like image 160
ChrisV Avatar answered Oct 05 '22 23:10

ChrisV