如何使用cuda 6.5显卡编程

GPU高性能编程CUDA实战-(美)桑德斯-计算机与互联网-文轩网
定  价 : ¥39.00
文 轩 价 : ¥31.20 (8.0折)
配 送 至 : 中国四川省成都市
中国 四川省 成都市 请选择
作  者 :
所属分类 :
购买数量 :
件 此商品已售出0本
服  务 : 由"文轩网"直接销售和发货,并提供售后服务 |||
¥31.20 (8.0折)
作 者:(美) 出版社: 出版时间: 开 本:16开 页 数:201 印刷时间: 字 数:无 装 帧:平装 语  种:中文 版 次:1 印 次:1 I S B N:3
重磅推荐 文艺小说 少儿童书 经管励志 居家生活 科技考试
¥42.00¥60.00
¥64.00¥80.00
¥133.20¥180.00
¥31.50¥42.00
¥22.70¥32.00
¥27.70¥38.00
¥59.50¥85.00
¥23.70¥34.80
¥17.30¥29.80
¥62.40¥78.00
¥20.20¥32.00
¥56.90¥79.00
¥29.60¥39.50
¥20.20¥32.00
¥17.90¥29.80
¥64.20¥94.40
¥20.00¥32.80
¥15.50¥25.00
¥25.50¥39.80
¥22.60¥32.80
¥27.40¥45.00
¥18.20¥25.00
¥25.20¥35.00
¥28.80¥39.50
¥193.80¥285.00
¥23.40¥32.00
¥544.00¥680.00
¥68.20¥96.00
¥9.00¥12.50
¥27.10¥39.80
¥7.30¥10.00
¥8.60¥12.00
¥11.20¥16.00
¥12.80¥22.00
¥53.70¥88.00
¥10.20¥15.00
¥66.00¥88.00
¥54.50¥79.00
¥31.10¥42.00
¥44.90¥59.80
¥19.40¥29.80
¥25.90¥36.00
¥18.20¥28.00
¥16.20¥25.00
¥19.40¥29.80
¥20.20¥32.00
¥34.30¥49.00
¥24.70¥39.80
¥34.40¥49.80
¥28.70¥39.80
¥33.40¥49.80
¥6.90¥10.00
¥11.50¥16.00
¥24.30¥38.00
¥23.20¥38.00
¥27.50¥39.80
¥35.90¥49.80
¥24.20¥35.00
¥25.50¥39.80
¥46.90¥68.00
¥18.10¥25.80
¥36.90¥49.90
¥15.20¥23.80
¥56.20¥76.00
¥4.90¥6.80
¥12.40¥18.00
¥27.10¥39.80
¥7.10¥10.00
¥14.10¥19.80
¥14.40¥24.80
¥23.70¥32.00
¥35.30¥49.00
&&&&《GPU高性能编程CUDA实战》由CUDA软件平台小组的两位高级工程师撰写,向广大程序员介绍了如何使用这项新技术作者通过多个示例详细介绍了CUDA开发中的方方面面《GPU高性能编程CUDA实战》首先简要介绍了CUDA平台和架构,并快速介绍了CUDA&C,随后详细介绍了CUDA每个功能中的关键技术与权衡因素一通过学习这些内容,你可以很清楚地了解CUDAC中每个功能的适用场合,并编写出高性能的CUDA软件。&&&&CUDA是一种专门为提高并行程序开发效率而设计的计算架构在构建高性能应用程序时,与综合性软件平台相结合,CUDA架构能充分发挥GPU的强大计算功能很长时间以来,GPU一直用于图形和游戏应用程序中但是现在,使用CUDA可将GPU用于科学计算、工程以及金融等其他应用领域由于在CUDA中使用的编程语言只是一种对标准C语言进行简单扩展的语言,所以开发人员不需要具备任何计算机图形学的背景知识就可以掌握。&
隐藏全部&&&&&&桑德斯(Jason&Sanders),是NVIDIA公司CUDA平台小组的高级软件工程师。他在NVIDIA的工作包括帮助开发早期的CUDA系统软件,并参与OpenCL&1.0规范的制定,该规范是一个用于异构计算的行业标准。Jason在加州大学伯克利分校获得计算机科学硕士学位,他发表了关于GPU计算的研究论文。此外,他还获得了普林斯顿大学电子工程专业学士学位。在加入NVIDIA公司之前,他曾在ATI技术公司、Apple公司以及Novell公司工作过。&&&&Edward&Kandrot是NVIDIA公司CUDA平台小组的高级软件工程师。他在代码性能优化方面拥有20多年的工作经验,他曾经在Adobe公司Microsoft公司以及Autodesk公司等工作过。&
隐藏全部&&译者序序前言致谢作者简介第1章&为什么需要CUDA1.1&本章目标1.2&并行处理的历史1.3&GPU计算的崛起1.4&CUDA1.5&CUDA的应用1.6&本章小结第2章&入门2.1&本章目标2.2&开发环境2.3&本章小结第3章&CUDAC简介3.1&本章目标3.2&第一个程序3.3&查询设备3.4&设备属性的使用3.5&本章小结第4章&CUDAC并行编程4.1&本章目标4.2&CUDA并行编程4.3&本章小结第5章&线程协作5.1&本章目标5.2&并行线程块的分解5.3&共享内存和同步5.4&本章小结第6章&常量内存与事件6.1&本章目标6.2&常量内存6.3&使用事件来测量性能6.4&本章小结第7章&纹理内存7.1&本章目标7.2&纹理内存简介7.3&热传导模拟7.4&本章小结第8章&图形互操作性8.1&本章目标8.2&图形互操作8.3&基于图形互操作性的GPU波纹示例8.4&基于图形互操作性的热传导8.5&DirectX互操作性8.6&本章小结第9章&原子性9.1&本章目标9.2&计算功能集9.3&原子操作简介9.4&计算直方图9.5&本章小结第10章&流10.1&本章目标10.2&页锁定主机内存10.3&CUDA流10.4&使用单个CUDA流10.5&使用多个CUDA流10.6&GPU的工作调度机制10.7&高效地使用多个CUDA流10.8&本章小结第11章&多GPU系统上的CUDAC11.1&本章目标11.2&零拷贝主机内存11.3&使用多个GPU11.4&可移动的固定内存11.5&本章小结第12章&后记12.1&本章目标12.2&CUDA工具12.3&参考资料12.4&代码资源12.5&本章小结附录&高级原子操作&
隐藏全部&&&&&&当人们在探索如何提升个人计算机的性能时,超级计算机中性能提升方式引出了一个很好的问题:为什么不在个人计算机中放置多个处理器,而不是仅提升单个处理器核的性能?这样,在不需要提高处理器运行频率的情况下,个人计算机的性能就能获得持续的提升。&&&&在2005年,当面对竞争日趋激烈的市场以及越来越少的可行方式时,业界一些领先的CPIJ制造商们开始提供带有两个计算核的处理器。在接下来的几年中,他们延续了这种发展趋势,不断推出3核、4核、6核以及8核的中央处理器。这种趋势也称为多核革命(Multicore&Revolution),它标志着在个人计算机上开始发生重大的转变。&&&&当前,要购买一台单核CPIJ的桌面计算机已经比较困难了。即使在低端、低能耗的中央处理器中,通常都包含有两个或多个计算核。一些业界领先的CPU制造商已经宣布在未来将计划推出12核和16核的CPU,这进一步证明了并行计算已经给人们带来了不可忽视的好处。&&&&1.3&GPU计算的崛起&&&&与中央处理器传统的数据处理流水线相比,在图形处理器(Graphics&Processing&unit,GPU)上执行通用计算还是一个新概念。事实上,在计算领域中,GPU本身在很大程度上就是一个新概念。然而,在图形处理器上执行计算却并非新概念。&&&&1.3.1&GPU简史&&&&在前面介绍了中央处理器在时钟频率和处理器核数量上的发展历程。与此同时,图形处理技术同样经历了巨大的变革。在20世纪80年代晚期到90年代早期之间,图形界面操作系统(例如Microsoft公司的Windows)的普及推动了新型处理器的出现。在20世纪90年代早期,用户开始购买配置2D显示加速器卡的个人计算机。这些显卡提供了基于硬件的位图运算功能,能够在图形操作系统的显示和可用性上起到辅助作用。&&&&……
隐藏全部&&
好评 中评 差评 天猫评论
文轩网作为纸质出版物网络销售平台,所售图书均为全新正版,请放心购买。
文轩网图书/音像单笔订单满38元免运费(内蒙古、青海、海南、新疆、西藏、宁夏及海外地区除外)。未满38元全国运费5元/单。
与文轩网合作的物流公司有:申通/圆通/CCES/港中能达/邮政经济快递/邮政平邮等。(发货系统自动匹配,暂时无法指定快递)
没有解决您的问题?
暂无提问,您可以咨询我们,我们会在一个工作日内响应~加载中,请稍候...
加载中,请稍候...
&&&商品评价
商品名称:
评价得分:
此评价对我
此评价对我
此评价对我
此评价对我
此评价对我
此评价对我
此评价对我
此评价对我
此评价对我
此评价对我
此评价对我
此评价对我
此评价对我
此评价对我
此评价对我
此评价对我
此评价对我
此评价对我
此评价对我
此评价对我CUDA3.2 + VS2008编程环境配置 - romi - 博客园
轻轻的风轻轻的梦,轻轻的晨晨昏昏,
淡淡的云淡淡的泪,淡淡的年年岁岁。
posts - 119, comments - 56, trackbacks - 0, articles - 0
CUDA(Compute Unified Device Architecture)到目前已经发布到4.2了,建议安装最新的,但是因为笔记本目前只支持cuda3.2,所以我只安装了cuda3.2。
cuda版本见官网:
首先必须说的:本文题目是cuda3.2+vs2008,其实cuda其他版本和vs其他版本安装是一样的。
可以用一个工具CUDA-Z检测一下显卡设备是否支持CUDA,这个工具还可以查看显卡设备的一些计算相关属性。
对了,一定要先将Visual Studio工具安装了,要不怎么玩呢是吧
1. 安装所需文件
共需三个文件:CUDA driver、toolKit、SDK
①CUDA driver:名字很高级,其实就是显卡驱动,能够在显卡上跑起cuda程序所需的驱动。很多博客文章里说显卡驱动必须和toolKit、SDK的版本一致,其实不是这样的,显卡驱动和toolKit、SDK一致当然可以,显卡驱动版本更高那也是可以的。CUDA driver通常有个版本号,比如260.99,你可以用驱动人生或驱动之家之类的软件查看一下当前的显卡驱动,后5位数字就是版本号,当前安装的驱动如果比要求的驱动版本低,那就要更新驱动了,更新到要求的或比要求高的都是可以的。不建议下载官网的驱动,速度太慢。。。
②toolKit:打开,找到适合需要的版本下载之
③SDK:同样找到需要的sdk下载之
我win32系统所需的两个工具包如下图:
安装:按此顺序安装即可 & & 驱动-&toolKit-&SDK
2.检测安装是否成功
三个步骤搞定后,桌面上有个NVIDIA GPU Computing SDK 3.2 Browser快捷方式,打开之,里面有很多示例,随便run一个,比如ocean_FFT,看到有一个模拟海平面的画面出来,说明你的安装成功了。
安装成功已完成第一步,下面就是如何成功地在VS2008中运用cuda
3.配置环境变量
安装好后,会默认配置好系统环境变量,比如CUDA_BIN_PATH、CUDA_INC_PATH、CUDA_LIB_PATH、NVSDKCOMPUTE_ROOT
这里,只需要在系统变量中Path值中添加一下sdk中的debug和release路径,如下:
...;C:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\NVIDIA GPU Computing SDK 3.2\C\bin\win32\Debug;C:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\NVIDIA GPU Computing SDK 3.2\C\bin\win32\Release
4.vs中运用cuda
sdk中有很多示例的工程文件,假如cuda sdk采用的是默认路径,那么示例在C:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\NVIDIA GPU Computing SDK 3.2\C\src里面(注意该路径默认如果是隐藏的,就在文件夹选项内设置显示所有文件和文件夹)
打开VS2008,打开项目,项目选择上面示例中的ocean_FFT,编译运行一下,是否也成功了?不出意外当然是可以运行的,因为这是人家专门做的示例程序,要不能编译运行那估计是你vs的问题。
5.在项目中用cuda
上面是用的别人的工程,自己怎么在工程中用cuda呢?网上会有很多人建议使用开勇的CUDA_VS_Wizard,这个工具确实牛逼,在cuda版本还是很低的时候确实是神兵利器,但是现在cuda3.2如果自己建工程也是不需要那么多的手工配置的,因为安装完toolKit后会有VS的生成规则的文件,在工程中加入该文件即可。实施不走如下:
首先建立一个空的win32控制台应用程序,建完后是什么文件都没有的;
然后在工程文件内新建一个.txt文件,在里面添加代码(代码在书上或网上抄一段,如果找不到,复制下段代码)
1 /*****第一个CUDA程序*******/
3 #include &stdio.h&
//C标准输入输出接口
4 #include &stdlib.h&
5 #include &cuda_runtime.h&
//使用runtime API
7 //CUDA初始化
8 bool InitCUDA()
//传回有计算能力的设备数(&1),没有回传回1,device 0是一个仿真装置,不支持CUDA功能
cudaGetDeviceCount(&count);
if(count == 0) //没有cuda计算能力的设备
fprintf(stderr,"There is no device.\n");
return false;
for(i=0;i&i++)
cudaDeviceP //设备属性
if (cudaGetDeviceProperties(&prop,i)==cudaSuccess) //取得设备数据,brief Returns information about the compute-device
if (prop.major&=1) //cuda计算能力
if (i==count)
fprintf(stderr,"There is no device supporting CUDA 1.x\n");
return false;
cudaSetDevice(i); //brief Set device to be used for GPU executions
return true;
43 int main()
if (!InitCUDA())
printf("CUDA initialized.\n");
然后将.txt文件重命名为.cu文件,在项目中加入该.cu文件
下面进行项目属性设置
详细图文设置见
项目名右键,选择自定义生成规则,在可用规则文件里面选择CUDA Runtime API Rule(v3.2)
这时项目属性的配置属性里就多了CUDA Runtime API这个选项,里面已经设置好了不用去管它
再在配置属性&链接器&常规选项的附加库目录里面,添加$(NVSDKCOMPUTE_ROOT)\C\common\lib和$(CUDA_LIB_PATH)
在配置属性&链接器&输入选项的附加依赖项里添加cudart.lib &cutil32D.lib
编译运行。。。显卡支持cuda会出现CUDA initialized. & & 如果有问题,建议打开sdk中的工程看下别人是怎么设置的,然后用到本项目下
题外话:如果你是使用开勇的CUDA_VS_Wizard,编译或链接或显示结果出现问题都不要奇怪,因为这个工具用的是cuda2,生成规则要换成v3.2版的,而且链接库的路径名可能不同也要修改,另外,使用该向导写程序不能跟踪调试。
6.添加Visual Asissit X支持
上面的.cu文件内的代码没有语法高亮,Visual Asisst X工具可以完成该功能,该部分网上有详细的方案,这里我将步骤摘录下来:
设置好了后,工程中添加cuda文件就不需要再用txt转了,在添加新项里就有cuda文件(.cu文件)
最后,祝CUDA之旅愉快!2942人阅读
第一步 &先确定你的显卡 是不是N卡(控制面板 &&& 》系统》设备管理器》显示适配器)
第二步 & &查看你的显卡 在不在 支持的显卡 行列 &&/cuda-gpus
第三步 & 安装( windows电脑中 须是 vs2008 & vs2005)
CUDA Development Tools &&/cuda-downloads
NVIDIA CUDA Getting Started Guide for Microsoft Windows
Introduction
CUDA(TM) is a parallel computing platform and programming model invented by NVIDIA. It enables dramatic increases in computing performance by harnessing the power of the graphics processing unit (GPU).
CUDA was developed with several design goals in mind:
Provide a small set of extensions to standard programming languages, like C, that enable a straightforward implementation of parallel algorithms. With CUDA C/C++, programmers can focus on the task of parallelization of the algorithms rather than
spending time on their implementation. Support heterogeneous computation where applications use both the CPU and GPU. Serial portions of applications are run on the CPU, and parallel portions are offloaded to the GPU. As such, CUDA can be incrementally applied to existing applications.
The CPU and GPU are treated as separate devices that have their own memory spaces. This configuration also allows simultaneous computation on the CPU and GPU without contention for memory resources.
CUDA-capable GPUs have hundreds of cores that can collectively run thousands of computing threads. These cores have shared resources including a register file and a shared memory. The on-chip shared memory allows parallel tasks running on these cores to share
data without sending it over the system memory bus.
This guide will show you how to install and check the correct operation of the CUDA development tools.
System Requirements
To use CUDA on your system, you will need the following:
CUDA-capable GPUMicrosoft Windows XP, Vista, 7, or 8 or Windows Server 2003 or 2008NVIDIA CUDA Toolkit (available at no cost from ) Microsoft Visual Studio 2008 or 2010, or a corresponding version of Microsoft Visual C++ Express
About This Document
This document is intended for readers familiar with Microsoft Windows XP, Microsoft Windows Vista, or Microsoft Windows 7 operating systems and the Microsoft Visual Studio environment. You do not need previous experience with CUDA or experience
with parallel computation.
Installing CUDA Development Tools
The installation of CUDA development tools on a system running the appropriate version of Windows consists of a few simple steps:
Verify the system has a CUDA-capable GPU.Download the NVIDIA CUDA Toolkit.Install the NVIDIA CUDA Toolkit.Test that the installed software runs correctly and communicated with the hardware.
Verify You Have a CUDA-Capable GPU
To verify that your GPU is CUDA-capable, open the
Control Panel (Start &
Control Panel) and double click on
System.&In the System Properties window that opens, click the
Hardware tab, then Device Manager. Expand the
Display adapters entry. There you will find the vendor name and model of your graphics card. If it is an NVIDIA card that is listed in
, your GPU is CUDA-capable.
The Release Notes for the CUDA Toolkit also contain a list of supported products.
Download the NVIDIA CUDA Toolkit
The NVIDIA CUDA Toolkit is available at .
Choose the platform you are using and download the NVIDIA CUDA Toolkit
The NVIDIA CUDA Toolkit contains the driver and tools needed to create, build and run a CUDA application as well as libraries, header files, CUDA samples source code, and other resources.
Install the CUDA Software
Before installing the toolkit, you should read the
Release Notes, as they provide details on installation and software functionality.
Install the CUDA Toolkit by executing the Toolkit installer and following the on-screen prompts.
Note: The driver and toolkit must be installed for CUDA to function. If you have not installed a stand-alone driver, install the driver from the NVIDIA CUDA Toolkit.
You can choose what to install from the following packages:
Note: If you want to install the CUDA Driver for new hardware, and have already installed the CUDA Driver before, you can launch the CUDA Driver installer from the Start Menu under:
NVIDIA Corporation\CUDA Toolkit\v5.0, or
NVIDIA Corporation\CUDA Toolkit\v5.0 (64 bit)
CUDA Driver
The CUDA Driver installation can be done silently or by using a GUI. A silent installation of the driver is done by enabling that feature when choosing what to install.
Silent: Only the display driver will be installed. GUI: A window will appear after the CUDA Toolkit installation if you allowed it at the last dialog with the full driver installation UI. You can choose which features you wish to install.
CUDA Toolkit
The CUDA Toolkit installation defaults to
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v#.#, where
#.# is version number 3.2 or higher. This directory contains the following:
Bin\the compiler executables and runtime librariesInclude\the header files needed to compile CUDA programsLib\the library files needed to link CUDA programsDoc\the CUDA C Programming Guide,
CUDA C Best Practices Guide, documentation for the CUDA libraries, and other CUDA Toolkit-related documentation
Note: CUDA Toolkit versions 3.1 and earlier installed into
C:\CUDA by default, requiring prior CUDA Toolkit versions to be uninstalled before the installation of new versions. Beginning with CUDA Toolkit 3.2, multiple CUDA Toolkit versions can be installed simultaneously.
CUDA Samples
The CUDA Samples contain source code for many example problems and templates with Microsoft Visual Studio 2008 and 2010 projects.
For Windows XP, the samples can be found here:
C:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\CUDA Samples\v5.0
For Windows Vista, Windows 7, and Windows Server 2008, the samples can be found here:
C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.0
Note: The NVIDIA CUDA Toolkit installer only installs Visual Studio project templates for toolkit version 5.0 and higher. Installing NVIDIA(R) Nsight(TM), Visual Studio Edition will install Visual Studio project
templates for toolkit versions earlier than CUDA 5.0.
Verify the Installation
Before continuing, it is important to verify that the CUDA programs can find and communicate correctly with the CUDA-capable hardware. To do this, you need to compile and run some of the included sample programs.
Running the Compiled Examples
The version of the CUDA Toolkit can be checked by running
nvcc -V in a Command Prompt window. You can display a
Command Prompt window by going to:
Start & All Programs & Accessories & Command Prompt
CUDA Samples include sample programs in both source and
compiled form. To verify a correct configuration of the hardware and software, it is highly recommended that you run the
deviceQuery program located here:
Windows XP:
C:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\CUDA Samples\v5.0\C\bin\win32\Release
Windows Vista, Windows 7, Windows 8, Windows Server 2003, and Windows Server 2008:
C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.0\C\bin\win32\Release
This assumes that you used the default installation directory structure. (On 64-bit versions of Windows, the directory name ends with
\win64\Release.) If CUDA is installed and configured correctly, the output should look similar to
Figure 1. Valid Results from Sample CUDA Device Query Program
The exact appearance and the output lines might be different on your system. The important outcomes are that a device was found, that the device(s) match what is installed in your system, and that the test passed.
If a CUDA-capable device and the CUDA Driver are installed but
deviceQuery reports that no CUDA-capable devices are present, ensure the deivce and driver are properly installed.
Running the bandwidthTest program, located in the same directory as
deviceQuery above, ensures that the system and the CUDA-capable device are able to communicate correctly. The output should resemble
Figure 2. Valid Results from Sample CUDA Bandwidth Test Program
The device name (second line) and the bandwidth numbers vary from system to system. The important items are the second line, which confirms a CUDA device was found, and the second-to-last line, which confirms that all necessary tests passed.
If the tests do not pass, make sure you do have a CUDA-capable NVIDIA GPU on your system and make sure it is properly installed.
To see a graphical representation of what CUDA can do, run the sample Particles executable in:
For Windows XP:
c:\Documents and Settings\All Users\Application Data\CUDA Samples\v5.0\C\bin\win32\Release
(or …\win64\Release on 64-bit Windows)
For Windows Vista, Windows 7, Windows 8, Windows Server 2003, and Windows Server 2008:
C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.0\C\bin\win32\Release
(or …\win64\Release on 64-bit Windows)
Compiling CUDA Programs
The project files in the CUDA Samples have been designed to provide simple, one-click builds of the programs that include all source code. To build the 32-bit or 64-bit Windows projects (for release or debug mode), use the provided
*.sln solution files for Microsoft Visual Studio 2008 or 2010 (and likewise for the corresponding versions of Microsoft Visual C++ Express Edition). You can use either the solution files located in each of the examples directories
CUDA Samples\v5.0\C\&category&\&sample_name&
or the global solution files Samples*.sln located in
CUDA Samples\v5.0\C
CUDA Samples are organized according to &category&. Each sample is organized into one of the following folders: (0_Simple,
1_Utilities, 2_Graphics,
3_Imaging, 4_Finance,
5_Simulations, 6_Advanced,
7_CUDALibraries).
Compiling Sample Projects
The bandwidthTest project is a good sample project to build and run. It is located in the
NVIDIA Corporation\CUDA Samples\v5.0\C\1_Utilities\bandwidthTest directory.
The output is placed in CUDA Samples\C\v5.0\bin\win32\Release. (As mentioned previously, the
\win32 segment of this address will be
\win64 on 64-bit versions of Windows.) This location presumes that you used the default installation directory structure. Build the program using the appropriate solution file and run the executable. If all works correctly, the output should be similar
Sample Projects
The sample projects come in two configurations: debug and release (where release contains no debugging information).
A few of the example projects require some additional setup. The
simpleD3D9 example requires the system to have a Direct3D SDK installed and the Visual C++ directory paths (located in
Options...) properly configured. Consult the Direct3D documentation for additional details.
These sample projects also make use of the $CUDA_PATH environment variable to locate the CUDA Toolkit and a
.rules file to locate and configure the
nvcc compiler. The environment variable is set automatically and the
.rules file is installed automatically as part of the CUDA Toolkit installation process.&The
.rules file is installed into
$VisualStudioInstallDir\VC\VCProjectDefaults. You can reference this
.rules file from your Visual Studio project files when building your own CUDA applications.
Build Customizations for New Projects
When creating a new CUDA application, the Visual Studio project file must be configured to include CUDA build customizations. To accomplish this, click File-& New | Project... NVIDIA-& CUDA-&, then select a template for your CUDA Toolkit version.
For example, selecting the &CUDA 5.0 Runtime& template will configure your project for use with the CUDA 5.0 Toolkit. The new project is technically a C++ project (.vcxproj) that is preconfigured to use NVIDIA's Build Customizations. All standard capabilities
of Visual Studio C++ projects will be available.
To specify a custom CUDA Toolkit location, under
CUDA C/C++, select Common, and set the
CUDA Toolkit Custom Dir field as desired. Note that the selected toolkit must match the version of the Build Customizations.
Build Customizations for Existing Projects
When adding CUDA acceleration to existing applications, the relevant Visual Studio project file must be updated to include CUDA build customizations. For Visual Studio 2010, this can be done using one of the following two methods:
Open the Visual Studio 2010 project, right click on the project name, and select
Build Customizations..., then select the CUDA Toolkit version you would like to target.
Alternatively, you can configure your project always to build with the most recently installed version of the CUDA Toolkit. First add a CUDA build customization to your project as above. Then, right click on the project name and select
Properties. Under CUDA C/C++, select
Common, and set the
CUDA Toolkit Custom Dir field to $(CUDA_PATH) .
While Option 2 will allow your project to automatically use any new CUDA Toolkit version you may install in the future, selecting the toolkit version explicitly as in Option 1 is often better in practice, because if there are new CUDA configuration
options added to the build customization rules accompanying the newer toolkit, you would not see those new options using Option 2.
Note for advanced users: If you wish to try building your project against a newer CUDA Toolkit without making changes to any of your project files, go to the Visual Studio 2010 command prompt,
change the current directory to the location of your project, and execute a command such as the following:
msbuild &projectname.extension& /t:Rebuild /p:CudaToolkitDir=&drive:/path/to/new/toolkit/&
Trademarks
NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.
Compute Capability
Quadro FX 1700
Quadro FX 570
Quadro FX 370
Compute Capability
Compute Capability
Compute Capability
GeForce 8, 9, 100, 200, 400-series, 500-series, and 600-series GPUs with a minimum of 256MB of local graphics memory.
Compute Capability
Compute Capability
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:11015次
排名:千里之外
原创:18篇
(1)(2)(1)(7)(6)(7)(1)(1)}

我要回帖

更多关于 nvidia cuda 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信