문제

I am on Ubuntu 12.04 LTS and have installed CUDA 5.5. I understand that without any CUDA/GPGPU elements in the code, nvcc behaves as a C/C++ compiler -- more like gcc, however is there any exception to this rule ? if not, then can I use nvcc as gcc for non-CUDA C/C++ codes ?

도움이 되었습니까?

해결책

No, nvcc doesn't behave like a C/C++ compiler for host code. What it does is the following:

  1. separate device from host code into two separate files
  2. compile device code (with nvcc, cudafe, ptxas)
  3. invoke gcc for host code

If no device code exists, nothing is done in steps 1) and 2). So nvcc is actually no compiler, it is a compiler driver which invokes the right compilers for every part in the right order. To answer your question, if you use nvcc to compile host code only, you still use gcc.

다른 팁

It doesn't accept options to suppress warnings ( -W*)

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