如何让 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.
一切都编译得很好,但我厌倦了看到到处都是红色下划线,我想看到当您输入任何可识别的函数时显示的示例参数.
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屋!