如何让VS 2010识别某些CUDA功能 [英] How to get VS 2010 to recognize certain CUDA functions
问题描述
目前,CUDA已经识别出一个关键的CUDA C / C ++函数,例如 cudaMalloc
, cudaFree
, cudaEventCreate
等。
At the moment CUDA already recognizes a key CUDA C/C++ function such as cudaMalloc
, cudaFree
, cudaEventCreate
, etc.
它还识别某些类型,例如 dim3
和 cudaEvent_t
。
It also recognizes certain types like dim3
and cudaEvent_t
.
但是,它不能识别其他函数和类型,如纹理模板, __ syncthreads
函数, atomicCAS
函数。
However, it doesn't recognize other functions and types such as the texture template, the __syncthreads
functions, or the atomicCAS
function.
一切都编译正常,但我厌倦了看到红色underlinings在所有的地方,我想看到示例参数显示时,你输入任何可识别的函数。
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.
如何让VS捕获这些函数?
How do I get VS to catch these functions?
推荐答案
您可以创建以下形式的虚拟#include文件:
You could create a dummy #include file of the following form:
#pragma once
#ifdef __INTELLISENSE__
void __syncthreads();
...
#endif
这应该隐藏假的原型CUDA和Visual C ++编译器,但仍然使IntelliSense可见。
This should hide the fake prototypes from the CUDA and Visual C++ compilers, but still make them visible to IntelliSense.
源 __ INTELLISENSE __
宏: http://blogs.msdn.com/b/vcblog/archive/ 2011/03/29 / 10146895.aspx
这篇关于如何让VS 2010识别某些CUDA功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!