目前,CUDA已经识别出一个关键的CUDA C/C++函数,如cudaMalloc
、cudaFree
和cudaEventCreate
等。
它还可以识别某些类型,如dim3
和cudaEvent_t
。
但是,它无法识别其他函数和类型,例如纹理模板、__syncthreads
函数或atomicCAS
功能。
一切都编译得很好,但我厌倦了到处都是红色的下划线,我想看看当你输入任何可识别的函数时显示的示例参数。
如何让VS捕获这些函数?
目前,CUDA已经识别出一个关键的CUDA C/C++函数,如cudaMalloc
、cudaFree
和cudaEventCreate
等。
它还可以识别某些类型,如dim3
和cudaEvent_t
。
但是,它无法识别其他函数和类型,例如纹理模板、__syncthreads
函数或atomicCAS
功能。
一切都编译得很好,但我厌倦了到处都是红色的下划线,我想看看当你输入任何可识别的函数时显示的示例参数。
如何让VS捕获这些函数?
您可以创建以下形式的伪#include文件:
#pragma once
#ifdef __INTELLISENSE__
void __syncthreads();
...
#endif
这应该会对CUDA和Visual C++编译器隐藏伪原型,但仍然使它们对IntelliSense可见。
__INTELLISENSE__
宏的来源:http://blogs.msdn.com/b/vcblog/archive/2011/03/29/10146895.aspx
您需要将特定于CUDA的关键字(如__syncthreads)添加到visualstudio的usertype.dat文件中。NVIDIA CUDA SDK中包含一个示例usertype.dat文件。您还需要确保visualstudio将.cu文件识别为c/c++文件,如这篇文章:
但是,请注意,如果该帖子使用$(CUDA_INC_PATH)
,则对于最新版本的CUDA,应使用$(CUDA _PATH)/include
。
此外,我建议Visual Assist X--不是免费的,但物有所值--可以提高智能。如果您遵循以下说明,它可以很好地与CUDA配合使用:
There has been a significant shift towards data-parallel programming via systems like OpenCL and CUDA over the last few years, and yet books published even within the last six months never even ...
I am trying to integrate CUDA and openCV in a project. Problem is openCV won t compile when NVCC is used, while a normal c++ project compiles just fine. This seems odd to me, as I thought NVCC ...
I need help please. I started to program a common brute forcer / password guesser with CUDA (2.3 / 3.0beta). I tried different ways to generate all possible plain text "candidates" of a defined ASCII ...
I was stepping through some C/CUDA code in the debugger, something like: for(uint i = threadIdx.x; i < 8379; i+=256) sum += d_PartialHistograms[blockIdx.x + i * HISTOGRAM64_BIN_COUNT]; And I ...
I m getting this error while trying to run sample codes in CUDA SDK. I have CUDA 2.3 and Visual studio 2008 LINK : fatal error LNK1181: cannot open input file cutil32D.lib Any pointers how to ...
My laptop doesn t have a nVidia graphic cards, and I want to work on CUDA. The website says that CUDA can be used in emulation mode on non-cuda hardware too. But when I tried installing CUDA drivers ...
I m trying to figure out a way to allocate a block of memory that is accessible by both the host (CPU) and device (GPU). Other than using cudaHostAlloc() function to allocate page-locked memory that ...
I have posted my problem in the CUDA forums, but not sure if it s appropriate to post a link here for more ideas in case there are significant number of different audiences between the two forums. The ...