问题描述
如何编译CUDA应用程序是Visual Studio 2010?
这是我的步骤:
1.创建没有预编译头的空C ++项目
2.添加main.cpp
int main()
{
return 0;
}
-
Add kernels.cu
我引用示例项目MAtrixMul并逐步复制其设置。
- 右 - 点击项目 - >生成自定义 - >检查cuda 3.2
- kernels.cu - >属性 - >使用CUDA C / C ++编译
- TRY编译:我收到错误:
- 将平台工具集更改为v90
- TRY编译:我收到错误:
-
创建C ++项目
-
) - >构建自定义检查Cuda 3.2编译器*
-
添加
cudart.lib
> linker-> input-> additional dependencies -
添加
main.cu
- > CUDA C / C ++ * -
项目 - >属性 - >配置属性 - > general - > v90工具集**
$ b Add kernels.cu
I referred to sample project MAtrixMul and copied its settings step by step. it can be complied now
- Right-Click on project -> Build customizations -> Check cuda 3.2
- kernels.cu -> properties ->Compile with CUDA C/C++
- TRY Compiling: I get error:
- Change Platform ToolSet to v90
- TRY Compiling: I get errors:
Create C++ project
Project(right click)->build customisation Check "Cuda 3.2 compiler"*
Add
cudart.lib
to properties->linker->input->additional dependenciesAdd
main.cu
-> properties Item type = CUDA C/C++*Project -> properties ->configuration Properties -> general -> v90 toolset**
__ global__ void VecAdd(float * A,float * B,float * C)
{
int i = threadId。 X;
C [i] = A [i] + B [i];
}
请帮我。
感谢,Ilya
是的,它是工作。
*)会在安装Nvidia Parallel Nsight后出现。要小心,你需要特殊的驱动程序,更多在NSight主页)
**)你需要instal visual c ++ 2008 express。
无论如何,示例项目仍然应该在。我抱怨的问题是,只是过时的驱动程序。
How to Compile CUDA App is Visual Studio 2010 ?
Here are my steps:1. Create Empty C++ project without precompiled headers2. Add main.cpp
int main()
{
return 0;
}
Please healp me out.
Thanks, Ilya
Yes i did, and it IS working.
*) will appear after you install Nvidia Parallel Nsight. Be careful, you need special drivers for that, more on NSight homepage)
**) you need to instal visual c++ 2008 express.
Anyway, example project still should be available at my nvidia forum post. The problem i'm complaining there about is just out-of-date drivers.
这篇关于如何编译CUDA应用程序是Visual Studio 2010?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!