I’m working on including CUDA elements into an existing C++ application. Ideally, I would like to call CUDA kernels from the dedicated *.cu source files that are #include’d in the C++ files. The problem I’m having is that as soon as a *.cu file is referenced from a *.cpp source, the compiler stops recognizing the CUDA source as such as throws errors along the lines of “expected constructor, destructor or type conversion before ‘void’” when there is a CUDA keyword in the line (like global).
The environment is Eclipse 3.6.1 Helios for 64-bit Linux with the CUDA plugin (ydl.net) installed. The project is defined to use the CUDA toolchain and everything compiles and links perfectly as long as there are no #include references to the *.cu files from within the *.cpp source.
Has anyone seen this type of behavior? Is there an alternative way to integrate CUDA code in a C++ application?
Any suggestions would be appreciated