accelerate-llvm 1.2.0.0 → 1.2.0.1
raw patch · 7 files changed
+71/−76 lines, 7 filesdep ~basedep ~llvm-hsdep ~llvm-hs-pure
Dependency ranges changed: base, llvm-hs, llvm-hs-pure
Files
- CHANGELOG.md +14/−0
- README.md +18/−14
- accelerate-llvm.cabal +9/−9
- src/Data/Array/Accelerate/LLVM/CodeGen/Downcast.hs +30/−16
- src/Data/Array/Accelerate/LLVM/Compile/Cache.hs-boot +0/−19
- src/Data/Array/Accelerate/LLVM/State.hs-boot +0/−17
- src/LLVM/AST/Type/Metadata.hs +0/−1
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 ### Added * support for half-precision floats@@ -38,6 +51,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.0...v1.2.0.0 [1.1.0.0]: https://github.com/AccelerateHS/accelerate-llvm/compare/1.0.0.0...1.1.0.0 [1.0.0.0]: https://github.com/AccelerateHS/accelerate-llvm/compare/be7f91295f77434b2103c70aa1cabb6a4f2b09a8...1.0.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.cabal view
@@ -1,7 +1,7 @@ name: accelerate-llvm-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 component generating LLVM IR@@ -27,7 +27,7 @@ . Example using Homebrew on macOS: .- > brew install llvm-hs/homebrew-llvm/llvm-6.0+ > brew install llvm-hs/llvm/llvm-8 . /Debian & Ubuntu/ .@@ -36,13 +36,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.@@ -163,7 +163,7 @@ Paths_accelerate_llvm build-depends:- base >= 4.7 && < 4.12+ base >= 4.7 && < 4.13 , abstract-deque >= 0.3 , accelerate == 1.2.* , bytestring >= 0.10.4@@ -174,8 +174,8 @@ , dlist >= 0.6 , exceptions >= 0.6 , filepath >= 1.0- , 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.0 , mwc-random >= 0.13 , primitive >= 0.6@@ -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/CodeGen/Downcast.hs view
@@ -57,9 +57,13 @@ import qualified LLVM.AST.Instruction as L import qualified LLVM.AST.IntegerPredicate as IP import qualified LLVM.AST.Name as L-import qualified LLVM.AST.Operand as L+import qualified LLVM.AST.Operand as LO import qualified LLVM.AST.RMWOperation as LA import qualified LLVM.AST.Type as L+#if MIN_VERSION_llvm_hs_pure(6,1,0)+#else+import qualified LLVM.AST.Type.Metadata as LM+#endif -- | Convert a value from our representation of the LLVM AST which uses@@ -359,27 +363,37 @@ -- LLVM.General.AST.Type.Operand -- ----------------------------- -instance Downcast (Operand a) L.Operand where- downcast (LocalReference t n) = L.LocalReference (downcast t) (downcast n)- downcast (ConstantOperand c) = L.ConstantOperand (downcast c)+instance Downcast (Operand a) LO.Operand where+ downcast (LocalReference t n) = LO.LocalReference (downcast t) (downcast n)+ downcast (ConstantOperand c) = LO.ConstantOperand (downcast c) -- LLVM.General.AST.Type.Metadata -- ------------------------------ -instance Downcast Metadata L.Operand where- downcast = L.MetadataOperand . downcast+instance Downcast Metadata LO.Operand where+ downcast = LO.MetadataOperand . downcast -instance Downcast Metadata L.Metadata where- downcast (MetadataStringOperand s) = L.MDString s- downcast (MetadataConstantOperand o) = L.MDValue (L.ConstantOperand o)- downcast (MetadataNodeOperand n) = L.MDNode (downcast n)+instance Downcast Metadata LO.Metadata where+ downcast (MetadataStringOperand s) = LO.MDString s+ downcast (MetadataConstantOperand o) = LO.MDValue (LO.ConstantOperand o)+ downcast (MetadataNodeOperand n) = LO.MDNode (downcast n) -instance Downcast MetadataNode L.MetadataNode where- downcast (MetadataNode n) = L.MetadataNode (downcast n)- downcast (MetadataNodeReference r) = L.MetadataNodeReference r+#if MIN_VERSION_llvm_hs_pure(6,1,0)+instance Downcast MetadataNode (LO.MDRef LO.MDNode) where+ downcast (MetadataNode n) = LO.MDInline (downcast n)+ downcast (MetadataNodeReference r) = LO.MDRef r +instance Downcast [Maybe Metadata] LO.MDNode where+ downcast = LO.MDTuple . map downcast+#else+instance Downcast MetadataNode LO.MetadataNode where+ downcast (MetadataNode n) = LO.MetadataNode (downcast n)+ downcast (MetadataNodeReference r) = LO.MetadataNodeReference r+#endif ++ -- LLVM.General.AST.Type.Terminator -- -------------------------------- @@ -409,7 +423,7 @@ -- Function -> callable operands (for Call instruction) ---instance Downcast (GlobalFunction args t) L.CallableOperand where+instance Downcast (GlobalFunction args t) LO.CallableOperand where downcast f = let trav :: GlobalFunction args t -> ([L.Type], L.Type, L.Name) trav (Body t n) = ([], downcast t, downcast n)@@ -419,9 +433,9 @@ (args, result, name) = trav f ty = L.PointerType (L.FunctionType result args False) (L.AddrSpace 0) in- Right (L.ConstantOperand (LC.GlobalReference ty name))+ Right (LO.ConstantOperand (LC.GlobalReference ty name)) -instance Downcast (GlobalFunction args t) [(L.Operand, [L.ParameterAttribute])] where+instance Downcast (GlobalFunction args t) [(LO.Operand, [L.ParameterAttribute])] where downcast Body{} = [] downcast (Lam _ x l) = (downcast x, []) : downcast l
− src/Data/Array/Accelerate/LLVM/Compile/Cache.hs-boot
@@ -1,19 +0,0 @@--- |--- Module : Data.Array.Accelerate.LLVM.Compile.Cache-boot--- Copyright : [2017] Trevor L. McDonell--- License : BSD3------ Maintainer : Trevor L. McDonell <tmcdonell@cse.unsw.edu.au>--- Stability : experimental--- Portability : non-portable (GHC extensions)-----module Data.Array.Accelerate.LLVM.Compile.Cache- where--import {-# SOURCE #-} Data.Array.Accelerate.LLVM.State--class Persistent arch--removeCacheDirectory :: Persistent arch => LLVM arch ()-
− src/Data/Array/Accelerate/LLVM/State.hs-boot
@@ -1,17 +0,0 @@--- |--- Module : Data.Array.Accelerate.LLVM.State-boot--- Copyright : [2017] Trevor L. McDonell--- License : BSD3------ Maintainer : Trevor L. McDonell <tmcdonell@cse.unsw.edu.au>--- Stability : experimental--- Portability : non-portable (GHC extensions)-----module Data.Array.Accelerate.LLVM.State- where--import Control.Monad.State--newtype LLVM target a = LLVM { runLLVM :: StateT target IO a }-
src/LLVM/AST/Type/Metadata.hs view
@@ -31,4 +31,3 @@ = MetadataStringOperand {-# UNPACK #-} !ShortByteString | MetadataConstantOperand !LLVM.Constant | MetadataNodeOperand !MetadataNode-