Question

I have 2 cpp files setup and functions, 6 .cu files main, flood, timestep, discharge, continuity and copy. I'm trying to compile this to the main call the cpp files and so the flood kernel global and then flood call timestep, discharge, continuity and copy kernels all device.

Something like this:

Main
~functions
~setup
~flood
~~timestep
~~discharge
~~continuity
~~copy

I'm using a GK110 board with CUDA 5.5, but i don't know how to compile in separate sources (I got an error, that device functions requires separation compile mode). I'm also dont know how to use -dc or -rtc={true} and flags for dynamic parallelism.

I tried to do this, but doesn't work:

g++  -c functions.cpp -std=c++0x 
g++  -c setup.cpp -std=c++0x  
nvcc -arch=sm_35 -dc timestep.cu copy.cu continuity.cu discharge.cu
nvcc -arch=sm_35 -dlink timestep.o copy.o continuity.o discharge.o -o link.o -lcudadevrt
nvcc -dc flood.cu -arch sm_35 

When i reach de fifth line I got the error message that the device function call cannot be configured.

Someone can help me?

Was it helpful?

Solution

Try:

g++  -c functions.cpp -std=c++0x 
g++  -c setup.cpp -std=c++0x  
nvcc timestep.cu copy.cu continuity.cu discharge.cu flood.cu -arch=sm_35 -lcudadevrt -rdc=true -c
nvcc timestep.o copy.o continuity.o discharge.o flood.o -arch=sm_35 -lcudadevrt -dlink -o dlink.o 
g++ functions.o steup.o dlink.o -o a.out -std=c++0x -L/<path>/cuda/lib<64,32> -lcudart -lcudadevrt
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top