Pregunta

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?

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top