top | item 16248393

(no title)

bilog | 8 years ago

CUDA uses a single-source approach, meaning that the host (CPU) and device (GPU) code are in the same file. So it requires a special compiler (nvcc) that splits the original source files, compiles the host and device parts separately, and then merges the result back together.

This requires nvcc and the device compiler to have exact knowledge of how the host compiler compiles every single construct (thing e.g. about alignment and padding in complex structures), and they must at least be able to parse the syntax of the host include files (which e.g. fails if the include files have C++11 syntax, but the device compiler only knows how to parse C++98).

discuss

order

No comments yet.