nvvm 0.9.0.0 → 0.10.0.0
raw patch · 4 files changed
+66/−5 lines, 4 filesdep +directorydep +filepathsetup-changedPVP ok
version bump matches the API change (PVP)
Dependencies added: directory, filepath
API changes (from Hackage documentation)
+ Foreign.NVVM.Path: nvvmDeviceLibraryPath :: FilePath
Files
- CHANGELOG.md +6/−0
- Foreign/NVVM/Path.hs +50/−0
- Setup.hs +4/−2
- nvvm.cabal +6/−3
CHANGELOG.md view
@@ -4,6 +4,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). +## [0.10.0.0] - 2020-08-26+### Added+ * Support for Cabal-3+ * `nvvmDeviceLibraryPath`+ ## [0.9.0.0] - 2018-10-02 ### Fixed * Build fix for ghc-8.6@@ -42,6 +47,7 @@ * First version. Released on an unsuspecting world. +[0.10.0.0]: https://github.com/tmcdonell/nvvm/compare/v0.9.0.0...v0.10.0.0 [0.9.0.0]: https://github.com/tmcdonell/nvvm/compare/v0.8.0.3...v0.9.0.0 [0.8.0.3]: https://github.com/tmcdonell/nvvm/compare/v0.8.0.2...v0.8.0.3 [0.8.0.2]: https://github.com/tmcdonell/nvvm/compare/v0.8.0.1...v0.8.0.2
+ Foreign/NVVM/Path.hs view
@@ -0,0 +1,50 @@+{-# LANGUAGE TemplateHaskell #-}+--------------------------------------------------------------------------------+-- |+-- Module : Foreign.NVVM.Path+-- Copyright : [2020] Trevor L. McDonell+-- License : BSD+--+--------------------------------------------------------------------------------++module Foreign.NVVM.Path (++ nvvmDeviceLibraryPath++) where++import Foreign.CUDA.Path++import Language.Haskell.TH+import System.Directory+import System.FilePath+import Data.List+++-- | Location of the libdevice bitcode file(s)+--+-- @since 0.10.0.0+--+nvvmDeviceLibraryPath :: FilePath+nvvmDeviceLibraryPath = $(do+ path <- runIO $ do+ let ubuntu = return "/usr/lib/nvidia-cuda-toolkit/libdevice"+ nvidia = return (cudaInstallPath </> "nvvm" </> "libdevice")+ --+ orElse this other = do+ path <- this+ yes <- doesDirectoryExist path+ if yes+ then do+ files <- getDirectoryContents path+ let bc = filter (\f -> "libdevice" `isPrefixOf` f && takeExtension f == ".bc") files+ if null bc+ then other+ else return path+ else other+ --+ nvidia `orElse` ubuntu `orElse` error "could not locate libdevice directory"+ --+ stringE path+ )+
Setup.hs view
@@ -83,7 +83,6 @@ main = defaultMainWithHooks customHooks where readHook get_verbosity args flags = do- noExtraFlags args getHookedBuildInfo (fromFlag (get_verbosity flags)) preprocessors = hookedPreProcessors simpleUserHooks@@ -124,7 +123,6 @@ currentPlatform = hostPlatform lbi compilerId_ = compilerId (compiler lbi) --- noExtraFlags args generateAndStoreBuildInfo verbosity profile currentPlatform compilerId_ generatedBuildInfoFilePath validateLinker verbosity currentPlatform $ withPrograms lbi --@@ -282,7 +280,11 @@ , ldOptions = ldOptions' , extraLibs = extraLibs' , extraLibDirs = extraLibDirs'+#if MIN_VERSION_Cabal(3,0,0)+ , options = PerCompilerFlavor (if os /= Windows then ghcOptions else []) []+#else , options = [(GHC, ghcOptions) | os /= Windows]+#endif , customFieldsBI = [c2hsExtraOptions] }
nvvm.cabal view
@@ -1,5 +1,5 @@ name: nvvm-version: 0.9.0.0+version: 0.10.0.0 synopsis: FFI bindings to NVVM description: The NVVM library compiles NVVM IR (a subset of LLVM IR) into PTX code which@@ -25,7 +25,7 @@ homepage: https://github.com/tmcdonell/nvvm author: Trevor L. McDonell <trevor.mcdonell@gmail.com> maintainer: Trevor L. McDonell <trevor.mcdonell@gmail.com>-copyright: [2016] Trevor L. McDonell+copyright: [2016..2018] Trevor L. McDonell category: Foreign build-type: Custom cabal-version: >= 1.24@@ -62,6 +62,7 @@ Foreign.NVVM.Compile Foreign.NVVM.Error Foreign.NVVM.Info+ Foreign.NVVM.Path other-modules: Foreign.NVVM.Internal.C2HS@@ -70,6 +71,8 @@ base >= 4.6 && < 5 , bytestring , cuda >= 0.8+ , directory+ , filepath , template-haskell build-tools:@@ -83,7 +86,7 @@ source-repository this type: git location: https://github.com/tmcdonell/nvvm- tag: v0.9.0.0+ tag: v0.10.0.0 -- vim: nospell