IPB

Welcome Guest ( Log In | Register )

> Simple CUDA build rule for Visual Studio 2005
JaredHoberock
post Mar 10 2007, 12:58 AM
Post #1



*****

Group: Extranet Users
Posts: 103
Joined: 7-September 06
Member No.: 25,750
Org.: NVIDIA



I've made a simple "build rule" for .cu files for Visual Studio 2005. This makes it so you don't have to manually define a custom build rule for every CUDA file in your project.

It simply invokes nvcc on the file and forwards the C/C++ options to cl.exe. You can also specify whether or not to compile emulation code.


To install the rule:

unzip cuda-build-rule.zip
right-click on your project in Visual Studio 2005
click Custom Build Rules...
click Find Existing...
browse to cuda.rules
check the box next to the CUDA listing in the Available Rule Files pane
click ok

Now you can compile .cu files in the same way as .c/.cpp.

Unfortunately, I don't see a way to easily fill in the default options for the different Debug,EmuDebug, etc configurations, so for now you have to do it by hand. The way I dealt with it is to make a template CUDA project, and fill in the defaults. I've also attached this template. To use it, you should have CUDA_INC_PATH, CUDA_LIB_PATH, CUDA_BIN_PATH, and CUDA_LIBRARIES defined in your environment.

Extending the rules to support the rest of the nvcc options would be simple but tedious, but if anyone does, please post it here so we can all use it! smile.gif
Attached File(s)
Attached File  cuda_build_rule.zip ( 2.94K ) Number of downloads: 4802
 
Go to the top of the page
 
+Quote Post

Posts in this topic
- JaredHoberock   Simple CUDA build rule for Visual Studio 2005   Mar 10 2007, 12:58 AM
- - jhanweck   Great addition -- definitely will give it a try --...   Mar 11 2007, 03:00 AM
- - thepolishpistol   Jared, Thanks for contributing this build rule, b...   Apr 9 2007, 07:04 AM
|- - JaredHoberock   QUOTE(thepolishpistol @ Apr 9 2007, 01:04 AM)...   Apr 9 2007, 08:13 PM
|- - thepolishpistol   Ah, that fixed it. Thanks! -skiz   Apr 10 2007, 02:48 AM
- - jhanweck   Jared, this is very helpful. Thanks. One problem...   Apr 10 2007, 07:18 PM
|- - JaredHoberock   QUOTE(jhanweck @ Apr 10 2007, 01:18 PM)Jared,...   Apr 10 2007, 07:37 PM
|- - Mark Harris   QUOTE(JaredHoberock @ Apr 10 2007, 08:37 PM)T...   Apr 16 2007, 10:22 AM
- - John Helmsen   QUOTEnvcc fatal  : A single input file is req...   Apr 11 2007, 04:30 PM
|- - JaredHoberock   QUOTE(John Helmsen @ Apr 11 2007, 10:30 AM)I...   Apr 12 2007, 07:33 PM
- - John Helmsen   QUOTE(JaredHoberock @ Apr 12 2007, 12:33 PM)C...   Apr 16 2007, 07:12 PM
|- - JaredHoberock   QUOTE(John Helmsen @ Apr 16 2007, 01:12 PM)C:...   Apr 16 2007, 07:16 PM
|- - ismailfaruqi   Hi, I'm new to CUDA. I managed to compile my s...   May 26 2007, 11:19 AM
- - maticus   Small bugfix (I think, because I'm not profici...   Oct 6 2007, 11:11 AM
- - bradley   hi, I have a huge solution with 2 projects. and ...   Oct 7 2007, 01:15 PM
- - maticus   My crystal ball is off today, sorry ;-) Give us at...   Oct 7 2007, 06:58 PM
|- - bradley   QUOTE(maticus @ Oct 8 2007, 02:58 AM)My cryst...   Oct 8 2007, 01:03 AM
|- - bradley   Hi, How i encounter another error. I've adde...   Oct 8 2007, 02:41 AM
- - yahastu   In order to open win32-console-app-cuda-msvc2005.v...   Feb 8 2008, 09:13 PM
|- - casybaby   Hi, Thx for sharing the build rule. But I encou...   Feb 26 2008, 08:33 PM
||- - casybaby   QUOTE(casybaby @ Feb 26 2008, 02:33 PM)Hi, ...   Feb 26 2008, 09:01 PM
|- - casybaby   Hi, I got this error when I was trying to s...   Mar 18 2008, 02:58 PM
|- - thesquiff   QUOTE (casybaby @ Mar 18 2008, 02:58 PM) ...   Feb 9 2009, 02:32 PM
|- - SynME   QUOTE (thesquiff @ Feb 9 2009, 07:32 AM) ...   Jun 9 2009, 11:38 PM
- - yannick.allusse   Hi JaredHoberock and thanks for this nice CUDA rul...   Mar 7 2008, 09:51 AM
|- - JaredHoberock   QUOTE(yannick.allusse @ Mar 7 2008, 03:51 AM)...   Mar 12 2008, 04:48 AM
- - KUNGFUPANDA   fatal error LNK1104: cannot open file '....   Mar 17 2008, 07:31 PM
- - yetta   I wanted to create my own project,and I have set ...   Apr 17 2008, 02:05 PM
- - kyzhao   I'v made a VS2005 project wizard for CUDA, fro...   Apr 18 2008, 02:34 PM


Reply to this topicStart new topic

 



Copyright 2008 NVIDIA Corporation.  Terms of Use | Legal Info | Privacy Policy Time is now: 26th November 2009 - 04:56 PM
Unites States Argentina Brazil Chile China Colombia France Germany India Italy Japan Korea Mexico Poland Russia Spain Taiwan United Kingdom Venezuela