accelerate-llvm-ptx 1.2.0.0 → 1.2.0.1
raw patch · 5 files changed
+51/−24 lines, 5 filesdep ~basedep ~containersdep ~cuda
Dependency ranges changed: base, containers, cuda, llvm-hs, llvm-hs-pure, nvvm
Files
- CHANGELOG.md +14/−0
- README.md +18/−14
- accelerate-llvm-ptx.cabal +10/−10
- src/Data/Array/Accelerate/LLVM/PTX/Compile.hs +4/−0
- src/Data/Array/Accelerate/LLVM/PTX/Link.hs +5/−0
CHANGELOG.md view
@@ -6,6 +6,19 @@ project adheres to the [Haskell Package Versioning Policy (PVP)](https://pvp.haskell.org) +## [1.2.0.1] - 2019-04-29+### Added+ * support for GHC-8.6+ * support for LLVM-7+ * support for LLVM-8++### Contributors++Special thanks to those who contributed patches as part of this release:++ * Trevor L. McDonell (@tmcdonell)+ * Viktor Kronvall (@considerate)+ ## [1.2.0.0] - 2018-04-03 ### Changed * `run` variants which do not take an explicit execution context now execute on@@ -55,6 +68,7 @@ * initial release +[1.2.0.1]: https://github.com/AccelerateHS/accelerate-llvm/compare/v1.2.0.0...v1.2.0.1 [1.2.0.0]: https://github.com/AccelerateHS/accelerate-llvm/compare/1.1.0.1-ptx...v1.2.0.0 [1.1.0.1]: https://github.com/AccelerateHS/accelerate-llvm/compare/1.1.0.0...1.1.0.1-ptx [1.1.0.0]: https://github.com/AccelerateHS/accelerate-llvm/compare/1.0.0.0...1.1.0.0
README.md view
@@ -67,7 +67,7 @@ Example using [Homebrew](http://brew.sh) on macOS: ```sh-$ brew install llvm-hs/homebrew-llvm/llvm-6.0+$ brew install llvm-hs/llvm/llvm-8 ``` ## Debian/Ubuntu@@ -78,17 +78,17 @@ then: ```sh-$ apt-get install llvm-6.0-dev+$ apt-get install llvm-8-dev ``` ## Building from source If your OS does not have an appropriate LLVM distribution available, you can also build from source. Detailed build instructions are available on the [LLVM.org website](http://releases.llvm.org/6.0.0/docs/CMake.html). Note that you will require at least [CMake 3.4.3](http://www.cmake.org/cmake/resources/software.html) and a recent C++ compiler; at least Clang 3.1, GCC 4.8, or Visual Studio 2015 (update 3). - 1. Download and unpack the [LLVM-6.0 source code](http://releases.llvm.org/6.0.0/llvm-6.0.0.src.tar.xz). We'll refer to+ 1. Download and unpack the [LLVM-8.0 source code](http://releases.llvm.org/8.0.0/llvm-8.0.0.src.tar.xz). We'll refer to the path that the source tree was unpacked to as `LLVM_SRC`. Only the main LLVM source tree is required, but you can optionally add other components- such as the Clang compiler or Polly loop optimiser. See the [LLVM releases](http://releases.llvm.org/download.html#6.0.0)+ such as the Clang compiler or Polly loop optimiser. See the [LLVM releases](http://releases.llvm.org/download.html#8.0.0) page for the complete list. 2. Create a temporary build directory and `cd` into it, for example:@@ -116,7 +116,7 @@ to [System Integrity Protection](https://en.wikipedia.org/wiki/System_Integrity_Protection): ```sh cd $INSTALL_PREFIX/lib- ln -s libLLVM.dylib libLLVM-6.0.dylib+ ln -s libLLVM.dylib libLLVM-8.0.dylib install_name_tool -id $PWD/libLTO.dylib libLTO.dylib install_name_tool -id $PWD/libLLVM.dylib libLLVM.dylib install_name_tool -change '@rpath/libLLVM.dylib' $PWD/libLLVM.dylib libLTO.dylib@@ -131,13 +131,13 @@ For example, installation using [`stack`](http://docs.haskellstack.org/en/stable/README.html) just requires you to point it to the appropriate configuration file: ```sh-$ ln -s stack-8.2.yaml stack.yaml+$ ln -s stack-8.6.yaml stack.yaml $ stack setup $ stack install ``` Note that the version of [`llvm-hs`](https://hackage.haskell.org/package/llvm-hs)-used must match the installed version of LLVM, which is currently 6.0.+used must match the installed version of LLVM, which is currently 8.0. ## libNVVM@@ -155,12 +155,16 @@ on the version of the CUDA toolkit you have installed. The following table shows some combinations: -| | LLVM-3.3 | LLVM-3.4 | LLVM-3.5 | LLVM-3.8 | LLVM-3.9 | LLVM-4.0 | LLVM-5.0 |-|:------------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|-| **CUDA-7.0** | ⭕ | ❌ | | | | | |-| **CUDA-7.5** | | ⭕ | ⭕ | ❌ | | | |-| **CUDA-8.0** | | | ⭕ | ⭕ | ❌ | ❌ | |-| **CUDA-9.0** | | | | | | ❌ | ❌ |+| | LLVM-3.3 | LLVM-3.4 | LLVM-3.5 | LLVM-3.8 | LLVM-3.9 | LLVM-4.0 | LLVM-5.0 | LLVM-6.0 | LLVM-7.0 | LLVM-8.0 |+|:-------------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|+| **CUDA-7.0** | ⭕ | ❌ | | | | | | | | |+| **CUDA-7.5** | | ⭕ | ⭕ | ❌ | | | | | | |+| **CUDA-8.0** | | | ⭕ | ⭕ | ❌ | ❌ | | | | |+| **CUDA-9.0** | | | | | | ❌ | ❌ | | | |+| **CUDA-9.1** | | | | | | | | | | |+| **CUDA-9.2** | | | | | | | | | | |+| **CUDA-10.0** | | | | | | | | | | |+| **CUDA-10.1** | | | | | | | | | | | Where ⭕ = Works, and ❌ = Does not work. @@ -168,7 +172,7 @@ want to use the NVVM component. Otherwise, you should be free to use any combination of CUDA and LLVM. -Also note that `accelerate-llvm-ptx` itself currently requires at least LLVM-3.5.+Also note that `accelerate-llvm-ptx` itself currently requires at least LLVM-4.0. Using `stack`, either edit the `stack.yaml` and add the following section:
accelerate-llvm-ptx.cabal view
@@ -1,7 +1,7 @@ name: accelerate-llvm-ptx-version: 1.2.0.0+version: 1.2.0.1 cabal-version: >= 1.10-tested-with: GHC >= 7.10+tested-with: GHC >= 8.0 build-type: Simple synopsis: Accelerate backend for NVIDIA GPUs@@ -26,7 +26,7 @@ . Example using Homebrew on macOS: .- > brew install llvm-hs/homebrew-llvm/llvm-6.0+ > brew install llvm-hs/llvm/llvm-8 . /Debian & Ubuntu/ .@@ -35,13 +35,13 @@ instructions for adding the correct package database for your OS version, and then: .- > apt-get install llvm-6.0-dev+ > apt-get install llvm-8-dev . /Building from source/ . If your OS does not have an appropriate LLVM distribution available, you can also build from source. Detailed build instructions are available on- <http://releases.llvm.org/6.0.0/docs/CMake.html LLVM.org>. Make sure to+ <http://releases.llvm.org/8.0.0/docs/CMake.html LLVM.org>. Make sure to include the cmake build options @-DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON@ so that the @libLLVM@ shared library will be built. Also ensure that the @LLVM_TARGETS_TO_BUILD@@@ -141,11 +141,11 @@ Paths_accelerate_llvm_ptx build-depends:- base >= 4.7 && < 4.12+ base >= 4.7 && < 4.13 , accelerate == 1.2.* , accelerate-llvm == 1.2.* , bytestring >= 0.10.4- , containers >= 0.5 && <0.6+ , containers >= 0.5 && <0.7 , cuda >= 0.9 , deepseq >= 1.3 , directory >= 1.0@@ -153,8 +153,8 @@ , file-embed >= 0.0.8 , filepath >= 1.0 , hashable >= 1.2- , llvm-hs >= 4.1 && < 6.1- , llvm-hs-pure >= 4.1 && < 6.1+ , llvm-hs >= 4.1 && < 8.1+ , llvm-hs-pure >= 4.1 && < 8.1 , mtl >= 2.2.1 , nvvm >= 0.7.5 , pretty >= 1.1@@ -215,7 +215,7 @@ source-repository this type: git- tag: 1.2.0.0+ tag: v1.2.0.1 location: https://github.com/AccelerateHS/accelerate-llvm.git -- vim: nospell
src/Data/Array/Accelerate/LLVM/PTX/Compile.hs view
@@ -233,7 +233,11 @@ -- Lower the generated module to bitcode, then compile and link together with -- the shim header and libdevice library (if necessary) bc <- LLVM.moduleBitcode mdl+#if MIN_VERSION_nvvm(0,9,0)+ ptx <- NVVM.compileModules (("",header) : (name,bc) : fmap (\(n,b) -> (S8.pack n, b)) libdevice) flags+#else ptx <- NVVM.compileModules (("",header) : (S8.unpack name,bc) : libdevice) flags+#endif unless (B.null (NVVM.compileLog ptx)) $ do Debug.traceIO Debug.dump_cc $ "llvm: " ++ B8.unpack (NVVM.compileLog ptx)
src/Data/Array/Accelerate/LLVM/PTX/Link.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-orphans #-}@@ -97,7 +98,11 @@ -> LaunchConfig -> IO (Kernel, Q (TExp (Int -> Int))) linkFunctionQ mdl name configure = do+#if MIN_VERSION_nvvm(0,9,0)+ f <- CUDA.getFun mdl name+#else f <- CUDA.getFun mdl (unpack name)+#endif regs <- CUDA.requires f CUDA.NumRegs ssmem <- CUDA.requires f CUDA.SharedSizeBytes cmem <- CUDA.requires f CUDA.ConstSizeBytes