I heard that it is better to compile CUDA kernels separately from host code. How do I do that with cmake? I am an absolute beginner in Cmake.
Thanks
As I know it is not possible, unless you do some hacks, with only one cmake command. You could write two CMakeLists.txt one for the CUDA code and one for host code. In the file for the host code you can add the CUDA stuff as library. After that you can write a shell script which executes the two commands for each CMakeLists.txt.
I usually do this with make. There I have two targets for CUDA and host code each compiled into an object file. A third target executes the others and then links the object files to an executable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With