Hi,
I have a working makefile to compile Fortran with CUDA on Linux. After changing all the environmental variables and makefile’s paths for Windows, same makefile seems like it works on Windows too. I don’t get any errors while compiling. But while running the executable, any kernel (even with a one line code) throws an “invalid device function” error. I have to compile the same program to work on Windows, so it’s a little bit crucial.
I really couldn’t understand “invalid device function” error. But according to this thread [topic=“0”]Invalid Device Function[/topic], it looks like I have some compiling or linking problems.
My makefile is simply like below;
[codebox]gcc -D_UF -O3 -c *.c
gfortran -c *.f
nvcc -c -arch sm_13 cuda.cu
gfortran -o program *.o cuda.obj -LC:/CUDA/lib/ -lcudart[/codebox]
-
I use MSYS so, -L option’s path slashes are different but it works that way.
-
FYI, I use double variables and I have a GTX 280. Even though while working with a one line kernel, my 8800 gives the same error.