I tried to compile following program (main.cu) with the nvcc (CUDA 5.0 RC):
#include <Eigen/Core>
#include <iostream>
int main( int argc, char** argv )
{
std::cout << "Pure CUDA" << std::endl;
}
Unfortunately, I get a bunch of warnings and errors I can only explain using nvcc instead of the Microsoft compile.
Is this assumption right? Is there any way to compile Eigen with nvcc? (I actually don′t want to transfer Eigen matrices to the GPU, just access their members)?
If it should not work to compile Eigen with nvcc, is there a nice guide/tutorial about clever ways to seperate host and device code?
I am using CUDA 5.0 RC, Visual Studio 2008, Eigen 3.0.5. To compile the .cu file I used both, the rules file included in CUDA, aswell as the custom build step produced by CMake. Using the CUDA rule file, I targeted the build at compute capability 3.0.
Thanks for your advice.
PS: If I compile the same code with the host compiler it works perfectly.
See Question&Answers more detail:os