diff options
author | Justin Lebar <jlebar@google.com> | 2016-09-07 20:09:53 +0000 |
---|---|---|
committer | Justin Lebar <jlebar@google.com> | 2016-09-07 20:09:53 +0000 |
commit | 7029cb5b8a3cd5437d441ea60487af4b961ed25b (patch) | |
tree | 52a85ff01231f2c8d831c14b376256a8fe4cb0a9 | |
parent | 5b4e0222d7246919bacc74c439f6038fba6759dd (diff) | |
download | bcm5719-llvm-7029cb5b8a3cd5437d441ea60487af4b961ed25b.tar.gz bcm5719-llvm-7029cb5b8a3cd5437d441ea60487af4b961ed25b.zip |
[CUDA] Simplify build/install instructions in CompileCudaWithLLVM.rst.
llvm-svn: 280850
-rw-r--r-- | llvm/docs/CompileCudaWithLLVM.rst | 68 |
1 files changed, 25 insertions, 43 deletions
diff --git a/llvm/docs/CompileCudaWithLLVM.rst b/llvm/docs/CompileCudaWithLLVM.rst index 8de21d679fc..89ee656c24a 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 <http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html>`_. -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 -<http://llvm.org/docs/GettingStarted.html>`_ 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 +<http://llvm.org/docs/GettingStarted.html>`_. - $ 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 <https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html>`_ +for details. Note that clang `does not support +<https://llvm.org/bugs/show_bug.cgi?id=26966>`_ 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 -<https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html>`_ 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++ |