I’m starting developing with CUDA. To learn I want to “translate” a program written in C. The first thing I tried was to simply change the extension from *.c to .cu of the file containing the main(). But here come the problems. If I compile every file (.c and *.cu) with nvcc it works like a charm but if i try to compile the *.c files with gcc and the *.cu file with nvcc and link the stuff together (with gcc) the program starts to give absurd results (but it compiles and links!). It would be nice to be able to separate compiling steps (I use a makefile) rather than using only nvcc. I use ubuntu and I tried with gcc4.3 and gcc4.2. I wanted to know if this is a known problem, or maybe I have to use some exotic flag to make this stuff work.
I’m programming in C so I usually use the --host-compilation c flag.
thanks for the help and have a nice weekend everyone