문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top