accelerate-cuda 0.12.1.1 → 0.12.1.2
raw patch · 6 files changed
+124/−94 lines, 6 filesdep +textdep −blaze-builderdep ~binarydep ~bytestringdep ~containers
Dependencies added: text
Dependencies removed: blaze-builder
Dependency ranges changed: binary, bytestring, containers, cryptohash, directory, fclabels, filepath, hashable, hashtables, language-c-quote, mainland-pretty, mtl, pretty, process, srcloc, transformers, unordered-containers
Files
- Data/Array/Accelerate/CUDA/CodeGen.hs +4/−4
- Data/Array/Accelerate/CUDA/CodeGen/Base.hs +2/−2
- Data/Array/Accelerate/CUDA/Compile.hs +9/−16
- Data/Array/Accelerate/CUDA/Execute.hs +12/−3
- accelerate-cuda.cabal +19/−19
- configure +78/−50
Data/Array/Accelerate/CUDA/CodeGen.hs view
@@ -506,10 +506,10 @@ codegenIntegralScalar ty x | IntegralDict <- integralDict ty = [cexp| ( $ty:(codegenIntegralType ty) ) $exp:(cintegral x) |] codegenFloatingScalar :: FloatingType a -> a -> C.Exp-codegenFloatingScalar (TypeFloat _) x = C.Const (FloatConst (shows x "f") (toRational x) noSrcLoc) noSrcLoc-codegenFloatingScalar (TypeCFloat _) x = C.Const (FloatConst (shows x "f") (toRational x) noSrcLoc) noSrcLoc-codegenFloatingScalar (TypeDouble _) x = C.Const (DoubleConst (show x) (toRational x) noSrcLoc) noSrcLoc-codegenFloatingScalar (TypeCDouble _) x = C.Const (DoubleConst (show x) (toRational x) noSrcLoc) noSrcLoc+codegenFloatingScalar (TypeFloat _) x = C.Const (FloatConst (shows x "f") (toRational x) noLoc) noLoc+codegenFloatingScalar (TypeCFloat _) x = C.Const (FloatConst (shows x "f") (toRational x) noLoc) noLoc+codegenFloatingScalar (TypeDouble _) x = C.Const (DoubleConst (show x) (toRational x) noLoc) noLoc+codegenFloatingScalar (TypeCDouble _) x = C.Const (DoubleConst (show x) (toRational x) noLoc) noLoc codegenNonNumScalar :: NonNumType a -> a -> C.Exp codegenNonNumScalar (TypeBool _) x = cbool x
Data/Array/Accelerate/CUDA/CodeGen/Base.hs view
@@ -71,7 +71,7 @@ ccall fn args = [cexp|$id:fn ($args:args)|] typename :: String -> Type-typename name = Type (DeclSpec [] [] (Tnamed (Id name noSrcLoc) noSrcLoc) noSrcLoc) (DeclRoot noSrcLoc) noSrcLoc+typename name = Type (DeclSpec [] [] (Tnamed (Id name noLoc) noLoc) noLoc) (DeclRoot noLoc) noLoc cchar :: Char -> Exp cchar c = [cexp|$char:c|]@@ -178,7 +178,7 @@ -- Turn a plain type into a ptr type -- cptr :: Type -> Type-cptr t | Type d@(DeclSpec _ _ _ _) r@(DeclRoot _) lb <- t = Type d (Ptr [] r noSrcLoc) lb+cptr t | Type d@(DeclSpec _ _ _ _) r@(DeclRoot _) lb <- t = Type d (Ptr [] r noLoc) lb | otherwise = t
Data/Array/Accelerate/CUDA/Compile.hs view
@@ -36,8 +36,6 @@ import Numeric import Prelude hiding ( exp, catch ) import Control.Applicative hiding ( Const )-import Blaze.ByteString.Builder-import Blaze.ByteString.Builder.Char8 import Control.Exception import Control.Monad import Control.Monad.Trans@@ -52,11 +50,12 @@ import System.IO import System.IO.Unsafe import System.Process-import Text.PrettyPrint.Mainland ( RDoc(..), ppr, renderCompact )-import Data.ByteString.Internal ( w2c )+import Text.PrettyPrint.Mainland ( ppr, renderCompact, displayLazyText ) import qualified Data.HashSet as Set import qualified Data.ByteString as B-import qualified Data.ByteString.Lazy as L+import qualified Data.Text.Lazy as T+import qualified Data.Text.Lazy.IO as T+import qualified Data.Text.Lazy.Encoding as T import qualified Foreign.CUDA.Driver as CUDA import qualified Foreign.CUDA.Analysis as CUDA @@ -360,12 +359,13 @@ compile table dev acc fvar = do exists <- isJust `fmap` liftIO (KT.lookup table key) unless exists $ do- message $ unlines [ show key, map w2c (L.unpack code) ]+ message $ unlines [ show key, T.unpack code ] nvcc <- fromMaybe (error "nvcc: command not found") <$> liftIO (findExecutable "nvcc") (file,hdl) <- openTemporaryFile "dragon.cu" -- rawr! flags <- compileFlags file (_,_,_,pid) <- liftIO $ do- L.hPut hdl code `finally` hClose hdl+ message $ "execute: " ++ nvcc ++ " " ++ unwords flags+ T.hPutStr hdl code `finally` hClose hdl createProcess (proc nvcc flags) `onException` removeFile file -- liftIO $ KT.insert table key (CompileProcess file pid)@@ -374,15 +374,8 @@ where cunit = codegenAcc dev acc fvar entry = show cunit- key = (CUDA.computeCapability dev, hashlazy code)- code = toLazyByteString- . layout . renderCompact $ ppr cunit- --- layout (RText _ s next) = fromString s `mappend` layout next- layout (RChar c next) = fromChar c `mappend` layout next- layout (RLine _ next) = fromChar '\n' `mappend` layout next -- no indenting- layout (RPos _ next) = layout next -- no line markers- layout REmpty = mempty -- done+ key = (CUDA.computeCapability dev, hashlazy (T.encodeUtf8 code) )+ code = displayLazyText . renderCompact $ ppr cunit -- Wait for the compilation process to finish
Data/Array/Accelerate/CUDA/Execute.hs view
@@ -1,6 +1,15 @@-{-# LANGUAGE UndecidableInstances, OverlappingInstances, IncoherentInstances #-}-{-# LANGUAGE BangPatterns, CPP, GADTs, ScopedTypeVariables, FlexibleInstances #-}-{-# LANGUAGE RankNTypes, TupleSections, TypeOperators, TypeSynonymInstances #-}+{-# LANGUAGE BangPatterns #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GADTs #-}+{-# LANGUAGE IncoherentInstances #-}+{-# LANGUAGE OverlappingInstances #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE TupleSections #-}+{-# LANGUAGE TypeOperators #-}+{-# LANGUAGE TypeSynonymInstances #-}+{-# LANGUAGE UndecidableInstances #-} {-# OPTIONS -fno-warn-orphans #-} -- | -- Module : Data.Array.Accelerate.CUDA.Execute
accelerate-cuda.cabal view
@@ -1,5 +1,5 @@ Name: accelerate-cuda-Version: 0.12.1.1+Version: 0.12.1.2 Cabal-version: >= 1.6 Tested-with: GHC >= 7.4 Build-type: Configure@@ -89,25 +89,25 @@ Build-depends: accelerate >= 0.12.1 && < 0.13, array >= 0.3 && < 0.5, base == 4.*,- binary == 0.5.*,- blaze-builder == 0.3.*,- bytestring == 0.9.*,- containers == 0.4.*,- cryptohash == 0.7.*,+ binary >= 0.5,+ bytestring >= 0.9,+ containers >= 0.4,+ cryptohash >= 0.7, cuda >= 0.4.1 && < 0.5,- directory >= 1.0 && < 1.2,- fclabels >= 1.0 && < 1.2,- filepath >= 1.0 && < 1.4,- hashable == 1.1.*,- hashtables >= 1.0.1 && < 1.1,- language-c-quote == 0.3.*,- mainland-pretty == 0.1.*,- mtl >= 2.0 && < 2.2,- pretty >= 1.0 && < 1.2,- process >= 1.0 && < 1.2,- srcloc == 0.1.*,- transformers >= 0.2 && < 0.4,- unordered-containers >= 0.1.4 && < 0.3+ directory >= 1.0,+ fclabels >= 1.0,+ filepath >= 1.0,+ hashable >= 1.1,+ hashtables >= 1.0.1,+ language-c-quote >= 0.4,+ mainland-pretty >= 0.2,+ mtl >= 2.0,+ pretty >= 1.0,+ process >= 1.0,+ srcloc >= 0.2,+ text >= 0.11,+ transformers >= 0.2,+ unordered-containers >= 0.1.4 if os(windows) build-depends: Win32 >= 2.2.1
configure view
@@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles.-# Generated by GNU Autoconf 2.69 for accelerate-cuda 0.12.1.1.+# Generated by GNU Autoconf 2.69 for accelerate-cuda 0.13.0.0. # # Report bugs to <accelerate-haskell@googlegroups.com>. #@@ -579,8 +579,8 @@ # Identity of this package. PACKAGE_NAME='accelerate-cuda' PACKAGE_TARNAME='accelerate-cuda'-PACKAGE_VERSION='0.12.1.1'-PACKAGE_STRING='accelerate-cuda 0.12.1.1'+PACKAGE_VERSION='0.13.0.0'+PACKAGE_STRING='accelerate-cuda 0.13.0.0' PACKAGE_BUGREPORT='accelerate-haskell@googlegroups.com' PACKAGE_URL='' @@ -591,7 +591,6 @@ ghc_flags type_hs_char type_hs_int-GHC OBJEXT EXEEXT ac_ct_CXX@@ -599,6 +598,7 @@ LDFLAGS CXXFLAGS CXX+GHC target_alias host_alias build_alias@@ -640,6 +640,9 @@ ac_subst_files='' ac_user_opts=' enable_option_checking+with_compiler+with_nvcc+with_gcc ' ac_precious_vars='build_alias host_alias@@ -1190,7 +1193,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF-\`configure' configures accelerate-cuda 0.12.1.1 to adapt to many kinds of systems.+\`configure' configures accelerate-cuda 0.13.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1251,10 +1254,17 @@ if test -n "$ac_init_help"; then case $ac_init_help in- short | recursive ) echo "Configuration of accelerate-cuda 0.12.1.1:";;+ short | recursive ) echo "Configuration of accelerate-cuda 0.13.0.0:";; esac cat <<\_ACEOF +Optional Packages:+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)+Haskell compiler+CUDA compiler+C compiler+ Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags@@ -1330,7 +1340,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF-accelerate-cuda configure 0.12.1.1+accelerate-cuda configure 0.13.0.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc.@@ -1385,7 +1395,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by accelerate-cuda $as_me 0.12.1.1, which was+It was created by accelerate-cuda $as_me 0.13.0.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@@@ -1737,9 +1747,59 @@ ac_config_files="$ac_config_files accelerate-cuda.buildinfo cubits/accelerate_cuda_shape.h" -# This doesn't pick up a user specified '--with-compiler' flag-#-ac_ext=cpp++# Check whether --with-compiler was given.+if test "${with_compiler+set}" = set; then :+ withval=$with_compiler; GHC=$withval+else+ # Extract the first word of "ghc", so it can be a program name with args.+set dummy ghc; ac_word=$2+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5+$as_echo_n "checking for $ac_word... " >&6; }+if ${ac_cv_path_GHC+:} false; then :+ $as_echo_n "(cached) " >&6+else+ case $GHC in+ [\\/]* | ?:[\\/]*)+ ac_cv_path_GHC="$GHC" # Let the user override the test with a path.+ ;;+ *)+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+ IFS=$as_save_IFS+ test -z "$as_dir" && as_dir=.+ for ac_exec_ext in '' $ac_executable_extensions; do+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then+ ac_cv_path_GHC="$as_dir/$ac_word$ac_exec_ext"+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5+ break 2+ fi+done+ done+IFS=$as_save_IFS++ ;;+esac+fi+GHC=$ac_cv_path_GHC+if test -n "$GHC"; then+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GHC" >&5+$as_echo "$GHC" >&6; }+else+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5+$as_echo "no" >&6; }+fi+++fi+++# Check whether --with-nvcc was given.+if test "${with_nvcc+set}" = set; then :+ withval=$with_nvcc; NVCC=$withval+else+ ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'@@ -2246,50 +2306,18 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -# Extract the first word of "ghc", so it can be a program name with args.-set dummy ghc; ac_word=$2-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5-$as_echo_n "checking for $ac_word... " >&6; }-if ${ac_cv_path_GHC+:} false; then :- $as_echo_n "(cached) " >&6-else- case $GHC in- [\\/]* | ?:[\\/]*)- ac_cv_path_GHC="$GHC" # Let the user override the test with a path.- ;;- *)- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR-for as_dir in $PATH-do- IFS=$as_save_IFS- test -z "$as_dir" && as_dir=.- for ac_exec_ext in '' $ac_executable_extensions; do- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then- ac_cv_path_GHC="$as_dir/$ac_word$ac_exec_ext"- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5- break 2- fi-done- done-IFS=$as_save_IFS-- ;;-esac fi-GHC=$ac_cv_path_GHC-if test -n "$GHC"; then- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GHC" >&5-$as_echo "$GHC" >&6; }-else- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5-$as_echo "no" >&6; }-fi +# Check whether --with-gcc was given.+if test "${with_gcc+set}" = set; then :+ withval=$with_gcc; CC=$withval+fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of Int" >&5 $as_echo_n "checking size of Int... " >&6; } @@ -2870,7 +2898,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log="-This file was extended by accelerate-cuda $as_me 0.12.1.1, which was+This file was extended by accelerate-cuda $as_me 0.13.0.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES@@ -2923,7 +2951,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\-accelerate-cuda config.status 0.12.1.1+accelerate-cuda config.status 0.13.0.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\"