From: Justin Lebar Date: Wed, 7 Sep 2016 20:09:53 +0000 (+0000) Subject: [CUDA] Simplify build/install instructions in CompileCudaWithLLVM.rst. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7029cb5b8a3cd5437d441ea60487af4b961ed25b;p=platform%2Fupstream%2Fllvm.git [CUDA] Simplify build/install instructions in CompileCudaWithLLVM.rst. llvm-svn: 280850 --- diff --git a/llvm/docs/CompileCudaWithLLVM.rst b/llvm/docs/CompileCudaWithLLVM.rst index 8de21d6..89ee656 100644 --- a/llvm/docs/CompileCudaWithLLVM.rst +++ b/llvm/docs/CompileCudaWithLLVM.rst @@ -1,5 +1,5 @@ =================================== -Compiling CUDA with LLVM +Compiling CUDA with clang =================================== .. contents:: @@ -8,57 +8,39 @@ Compiling CUDA with LLVM Introduction ============ -This document contains the user guides and the internals of compiling CUDA -code with LLVM. It is aimed at both users who want to compile CUDA with LLVM -and developers who want to improve LLVM for GPUs. This document assumes a basic -familiarity with CUDA. Information about CUDA programming can be found in the +This document describes how to compile CUDA code with clang, and gives some +details about LLVM and clang's CUDA implementations. + +This document assumes a basic familiarity with CUDA. Information about CUDA +programming can be found in the `CUDA programming guide `_. -How to Build LLVM with CUDA Support -=================================== - -CUDA support is still in development and works the best in the trunk version -of LLVM. Below is a quick summary of downloading and building the trunk -version. Consult the `Getting Started -`_ page for more details on setting -up LLVM. - -#. Checkout LLVM - - .. code-block:: console - - $ cd where-you-want-llvm-to-live - $ svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm - -#. Checkout Clang - - .. code-block:: console - - $ cd where-you-want-llvm-to-live - $ cd llvm/tools - $ svn co http://llvm.org/svn/llvm-project/cfe/trunk clang +Compiling CUDA Code +=================== -#. Configure and build LLVM and Clang +Prerequisites +------------- - .. code-block:: console +CUDA is supported in llvm 3.9, but it's still in active development, so we +recommend you `compile clang/LLVM from HEAD +`_. - $ cd where-you-want-llvm-to-live - $ mkdir build - $ cd build - $ cmake [options] .. - $ make +Before you build CUDA code, you'll need to have installed the appropriate +driver for your nvidia GPU and the CUDA SDK. See `NVIDIA's CUDA installation +guide `_ +for details. Note that clang `does not support +`_ the CUDA toolkit as installed +by many Linux package managers; you probably need to install nvidia's package. -How to Compile CUDA Code with LLVM -================================== +You will need CUDA 7.0 or 7.5 to compile with clang. CUDA 8 support is in the +works. -We assume you have installed the CUDA driver and runtime. Consult the `NVIDIA -CUDA installation guide -`_ if -you have not. +Building AXPY +------------- -Suppose you want to compile and run the following CUDA program (``axpy.cu``) -which multiplies a ``float`` array by a ``float`` scalar (AXPY). +Suppose you want to compile and run the following CUDA program (``axpy.cu``), +which multiplies a ``float`` array by a ``float`` scalar. .. code-block:: c++