Frage

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 ?

War es hilfreich?

Lösung

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.

Andere Tipps

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top