CUDA LLVM Compiler
NVIDIA’s CUDA Compiler (NVCC) is based on the widely used LLVM open source compiler infrastructure. Developers can create or extend programming languages with support for GPU acceleration using the NVIDIA Compiler SDK.
Add GPU Acceleration To Your Language
You can add support for GPU acceleration to a new or existing language by creating a language-specific frontend that compiles your language to the internal representation (IR) used by LLVM. Many language frontends already exist.
The IR generated by your front end is then optimized for execution on your target device. You can add support for a new device by developing a processor-specific backend which will perform the final compilation on the optimized LLVM IR.
NVIDIA has worked with the LLVM organization to contribute the CUDA compiler source code changes to the LLVM core and parallel thread execution backend, enabling full support of NVIDIA GPUs.
NVIDIA Compiler SDK
The SDK contains documentation, examples and tested binaries to get you started on your own GPU accelerated compiler project.
The following components of the NVIDIA Compiler SDK are shipped as part of the latest CUDA Toolkit Installer:
- An optimizing compiler library (libnvvm.so, nvvm.dll/nvvm.lib, libnvvm.dylib) and its header file nvvm.h are provided for compiler developers who want to generate PTX from a program written in NVVM IR, which is a compiler internal representation based on LLVM.
- A set of libraries, libdevice.*.bc, that implement the common math functions for devices in the LLVM bitcode format.
- A set of samples that illustrate the use of the compiler SDK.
- Documents for the Compiler SDK (including the specification for LLVM IR, an API document for libnvvm, and an API document for libdevice), can be found under the doc sub-directory, or online.
- The optimizing compiler libraries, the lidevice libraries and samples can be found under the nvvm sub-directory, seen after the CUDA Toolkit Install.
More libNVVM examples are provided at GitHub
Getting Support
- NVIDIA registered developers can file bugs via the CUDA Registered Developer Program
- Support is also available for all developers on our developer forums.
Source Availability
NVIDIA has contributed key enhancements to the LLVM project to enable support of CUDA and massively parallel accelerators such as GPUs. Source is available from theLLVM Project Home Site.