I am trying to reorganize a CUDA program I wrote into a better modularized structure. I separated the C from the CUDA bits, and compile each unit with their respective compilers, liking them in the end. Now I am trying to separate the CUDA kernels and the CUDA host code (the non-kernel part of the cuda call, such as cudaMalloc, cudaGetDeviceCount etc) in this unit [1].
Shall I compile the host code with nvcc as an cu file, or I can compile it with gcc as a C file?
I tried compiling the host code as a c file, but it always complains ‘cudaDeviceProp’ undeclared which I am pretty sure I’ve included the necessary header files.
thank you in advance for any suggestions.
[1] [url=“https://orbit.nmr.mgh.harvard.edu/plugins/scmsvn/viewcvs.php/mcextreme_cuda/trunk/src/mcx_core.cu?root=mcextreme&rev=114&view=markup”]https://orbit.nmr.mgh.harvard.edu/plugins/s...amp;view=markup[/url]