Using CUDA C and IFORT on Visual Studio done... at least

Hello,

edit : by the way, it is call Intel Visual Fortran and not IFORT under Windows

I had some hard times trying to make work both CUDA and IFORT in Visual Studio 2008. I looked all over the web, but didn’t find much answers.
So I give the one i found (maybe not the best), in case of there is people still stuck in this.
The name should not be exact since I try to translate it.

1.Create a new solution Visual Fortran
File > New project
Intel® Visual Fortran > Console Application
2. Download and install [url=“CUDA VS Wizard download | SourceForge.net”]http://sourceforge.net/projects/cudavswizard/[/url]
3. Add a new project in your solution
Visual C++ > CUDAWinApp
Choose Static library, uncheck “Precompiled header”
4. Right click on one of the two project → Project dependencies
Choose Fortran project and check the box matching the Cpp/CUDA project
5. Right click on the Fortran Project → define as starting project
6. Code both Fortran and Cuda
7. Make an interface for CUDA in the Fortran
INTERFACE
SUBROUTINE my_function_cuda(…) BIND©
USE, INTRINSIC :: ISO_C_BINDING
…arguments declaration
END SUBROUTINE
END INTERFACE
8. Add generation rules for CUDA
Right click on the Cuda Project > Custom generation rules
Find an existing file > choose the file Cuda rules from the Nvidia SDK (common/ directory)
9.Right click on the Fortran Project > properties
Linker > General
add $(CUDA_LIB_PATH) to “Additional Library Directories”
Linker > Input
add cudart.lib to “Additional Dependencies”

Done ! hope you do not catch arthrosis doing all this clicking.

Matt

PS: Thanks to the cuda wizard guys and to the website, which i forgot the name, for the last steps of this solution

Hey Thanks for this…

I tried following your steps on VS 2005 and Latest CUDA Toolkit and 32 BIT VS wizard.

I seem to get multiple errors of the sort

"error LNK2019: unresolved external symbol _cudaMalloc referenced in function … "

I am not sure whats wrong as I have added cudart.lib to the linker…

I generally do all my work in Linux ; this Windows (xp) + VS 2005 is new to me (my advisor wants me to make some code)… hence any help from anyone will be great ?

thanks in advance…

Nitin

Hey Thanks for this…

I tried following your steps on VS 2005 and Latest CUDA Toolkit and 32 BIT VS wizard.

I seem to get multiple errors of the sort

"error LNK2019: unresolved external symbol _cudaMalloc referenced in function … "

I am not sure whats wrong as I have added cudart.lib to the linker…

I generally do all my work in Linux ; this Windows (xp) + VS 2005 is new to me (my advisor wants me to make some code)… hence any help from anyone will be great ?

thanks in advance…

Nitin