2

I just got the CUDA drivers and the CUDA toolkit 4.2 installed onto my machine with all of the standard options. I have a CUDA capable NVIDIA GPU.

For some reason, the Visual Studio compiler, despite having the CUDA files located in the Program Files/MSBuild/Microsoft.cpp/v4.0/BuildCustomizations, will not compile a simple kernel function:

__global__ void kernel(void){

    //I do nothing :(

}

It registers a type specifier error on the __global__.

Is there something more that I have to do?

Also, I have been having some trouble (IDE's and I are never compatible) with Visual Studio and its want to create a ton of files. I added all of the source and header files by "Add" and selecting "Existing File," so I believe that my source files are not with Visual Studio's plethora of files.

Thank you in advance.

4

1 に答える 1

2

Did you enable CUDA build customizations and did you name your CUDA file with a ".cu" extension? To get to the build customizations in Visual Studio 2010, right click the CUDA project in the Solution Explorer and select Build Customizations.

于 2012-05-31T21:45:46.767 に答える