0
votes

I use templated CUDA (Thrust library) functions in my main cpp file, so I need to compile it with CUDA NVCC.

I'm worried about how NVCC will treat my host code. How host code optimization happen? Does NVCC pass the host code to the MSVC compiler and process only CUDA related code?

1

1 Answers

1
votes

Yes, nvcc is a compiler driver which separates the host and device code. The host code is passed directly to the host compiler (cl.exe in the case of microsoft windows), and optimization of host code is handled by the host compiler.

The nvcc documentation covers this compilation flow, and also indicates how to pass flags to the host compiler.