主机软件 · nvrtc

NVIDIA 运行时编译器NVIDIA Runtime Compiler

NVIDIA 运行时编译器(NVIDIA Runtime Compiler,简称 nvrtc) 是一个用于 CUDA C 的运行时编译库。它能够将 CUDA C++ 编译为 PTX,而无需在另一个进程中单独启动 NVIDIA CUDA 编译器驱动程序 (nvcc)。一些库或框架会使用它来实现特定功能,例如,将生成的 C/C++ 代码映射到可以在 GPU 上运行的 PTX 代码。

需要注意的是,生成的 PTX 随后会通过 JIT(即时)编译,从 PTX 中间表示 (IR) 进一步编译为 SASS 汇编代码。这一步由 NVIDIA GPU 驱动程序 完成,并且与 NVRTC 执行的编译是相互独立的。为实现向前兼容性而包含 PTX 的 CUDA 二进制文件,同样会经过这一编译步骤。

NVRTC 是闭源的。您可以在 此处 找到其文档。

英文原文(Modal GPU Glossary)

The NVIDIA Runtime Compiler (nvrtc) is a runtime compilation library for CUDA C. It compiles CUDA C++ to PTX without requiring a separate launch of the NVIDIA CUDA Compiler Driver (nvcc) in another process. It is used by some libraries or frameworks to, for example, map generated C/C++ code to PTX code that can run on a GPU.

Note that this PTX is then further JIT-compiled from the PTX IR to the SASS assembly. This is done by the NVIDIA GPU drivers and is distinct from the compilation done by NVRTC. CUDA binaries that contain PTX, as required for forward compatibility, also pass through this compilation step.

NVRTC is closed source. You can find its documentation here.

相关词条

本词条改编自 Modal GPU Glossary(CC BY 4.0)· 中文翻译 miter6/gpu-glossary-zh,MAE 整理排版。