How To Compile CUDA Code With LLVM

The new document explains how to compile CUDA with LLVM and for researchers/developers wanting to improve LLVM on GPUs. Building CUDA codes with LLVM/Clang still currently requires one out-of-tree patch, still obviously requires the CUDA driver/runtime from NVIDIA Corp, and setting various Clang arguments for generating the NVPTX code to then be consumed by NVIDIA's driver stack. The guide also covers some basic optimizations too.
If you want to take a look at the guide for compiling CUDA with LLVM, the document landed in Git.
The CUDA/NVPTX support in LLVM is getting into quite good shape. Google engineers even have been able to use LLVM to make faster CUDA code than NVIDIA's own NVCC compiler. In the GCC world there continues to be Code Sourcery still working on the NVPTX support there too and making OpenACC 2.0 work for NVIDIA GPUs on that compiler with less of a focus on CUDA.
Add A Comment