Permalink
Browse files

Merge with mega refactoring of repo

  • Loading branch information...
2 parents e0d0c62 + 597befe commit 85dd68337debc62866de19f000155daf2156b093 @rrnewton committed Apr 23, 2012
Showing with 579 additions and 20,683 deletions.
  1. +5 −0 .gitignore
  2. +15 −0 .gitmodules
  3. +3 −3 Data/Array/Accelerate.hs
  4. +8 −8 Data/Array/Accelerate/AST.hs
  5. +3 −2 Data/Array/Accelerate/Analysis/Shape.hs
  6. +32 −30 Data/Array/Accelerate/Analysis/Stencil.hs
  7. +2 −1 Data/Array/Accelerate/Analysis/Type.hs
  8. +8 −1 Data/Array/Accelerate/Array/Data.hs
  9. +7 −5 Data/Array/Accelerate/Array/Representation.hs
  10. +44 −24 Data/Array/Accelerate/Array/Sugar.hs
  11. +0 −92 Data/Array/Accelerate/CUDA.hs
  12. +0 −41 Data/Array/Accelerate/CUDA/Analysis/Device.hs
  13. +0 −143 Data/Array/Accelerate/CUDA/Analysis/Hash.hs
  14. +0 −146 Data/Array/Accelerate/CUDA/Analysis/Launch.hs
  15. +0 −612 Data/Array/Accelerate/CUDA/Array/Data.hs
  16. +0 −658 Data/Array/Accelerate/CUDA/CodeGen.hs
  17. +0 −41 Data/Array/Accelerate/CUDA/CodeGen/Data.hs
  18. +0 −280 Data/Array/Accelerate/CUDA/CodeGen/Skeleton.hs
  19. +0 −124 Data/Array/Accelerate/CUDA/CodeGen/Stencil.hs
  20. +0 −112 Data/Array/Accelerate/CUDA/CodeGen/Tuple.hs
  21. +0 −154 Data/Array/Accelerate/CUDA/CodeGen/Util.hs
  22. +0 −729 Data/Array/Accelerate/CUDA/Compile.hs
  23. +0 −836 Data/Array/Accelerate/CUDA/Execute.hs
  24. +0 −236 Data/Array/Accelerate/CUDA/State.hs
  25. +0 −33 Data/Array/Accelerate/IO.hs
  26. +0 −189 Data/Array/Accelerate/IO/BlockCopy.hs
  27. +0 −49 Data/Array/Accelerate/IO/ByteString.hs
  28. +0 −100 Data/Array/Accelerate/IO/Ptr.hs
  29. +0 −55 Data/Array/Accelerate/IO/Vector.hs
  30. +47 −22 Data/Array/Accelerate/Interpreter.hs
  31. +33 −24 Data/Array/Accelerate/Language.hs
  32. +314 −80 Data/Array/Accelerate/Prelude.hs
  33. +4 −0 Data/Array/Accelerate/Pretty.hs
  34. +2 −2 Data/Array/Accelerate/Pretty/Print.hs
  35. +1 −1 Data/Array/Accelerate/Pretty/Traverse.hs
  36. +16 −15 Data/Array/Accelerate/Smart.hs
  37. +0 −16 Data/Array/Accelerate/Test.hs
  38. +0 −16 Data/Array/Accelerate/Test/QuickCheck.hs
  39. +0 −236 Data/Array/Accelerate/Test/QuickCheck/Arbitrary.hs
  40. +1 −0 Data/Array/Accelerate/Tuple.hs
  41. +1 −0 Data/Array/Accelerate/Type.hs
  42. +4 −5 LICENSE
  43. +5 −2 README.md
  44. +0 −30 accelerate-buildbot/LICENSE
  45. +0 −2 accelerate-buildbot/Setup.hs
  46. +0 −35 accelerate-buildbot/accelerate-buildbot.cabal
  47. +0 −6 accelerate-buildbot/misc/banner.txt
  48. +0 −121 accelerate-buildbot/src/Args.hs
  49. +0 −151 accelerate-buildbot/src/Benchmarks.hs
  50. +0 −174 accelerate-buildbot/src/Build.hs
  51. +0 −105 accelerate-buildbot/src/Config.hs
  52. +0 −128 accelerate-buildbot/src/Main.hs
  53. +0 −30 accelerate-buildbot/src/Util.hs
  54. +1 −0 accelerate-cuda
  55. +0 −30 accelerate-examples/LICENSE
  56. +0 −13 accelerate-examples/Makefile
  57. +0 −2 accelerate-examples/Setup.hs
  58. +0 −96 accelerate-examples/accelerate-examples.cabal
  59. BIN accelerate-examples/data/images/lena.bmp
  60. +0 −5 accelerate-examples/data/images/lena_bw.pgm
  61. +0 −24 accelerate-examples/data/matrices/README.txt
  62. +0 −8,736 accelerate-examples/data/matrices/random.mtx
  63. +0 −31 accelerate-examples/data/matrices/small.mtx
  64. +0 −58 accelerate-examples/src/Benchmark.hs
  65. +0 −135 accelerate-examples/src/Config.hs
  66. +0 −74 accelerate-examples/src/Main.hs
  67. +0 −72 accelerate-examples/src/Random.hs
  68. +0 −234 accelerate-examples/src/Test.hs
  69. +0 −17 accelerate-examples/src/Util.hs
  70. +0 −102 accelerate-examples/src/Validate.hs
  71. +0 −24 accelerate-examples/tests/broken/quickcheck/LICENSE
  72. +0 −2 accelerate-examples/tests/broken/quickcheck/Setup.hs
  73. +0 −30 accelerate-examples/tests/broken/quickcheck/accelerate-tests.cabal
  74. +0 −24 accelerate-examples/tests/broken/quickcheck/src/Function.hs
  75. +0 −162 accelerate-examples/tests/broken/quickcheck/src/Main.hs
  76. +0 −223 accelerate-examples/tests/broken/quickcheck/src/Properties.hs
  77. +0 −244 accelerate-examples/tests/broken/rasterize/RasterizeAcc.hs
  78. +0 −4 accelerate-examples/tests/broken/rasterize/rasterize-test1.txt
  79. +0 −4 accelerate-examples/tests/broken/rasterize/rasterize-test2.txt
  80. +0 −4 accelerate-examples/tests/broken/rasterize/rasterize-test3.txt
  81. +0 −4 accelerate-examples/tests/broken/rasterize/rasterize-test4.txt
  82. +0 −111 accelerate-examples/tests/broken/rasterize/rasterize.hs
  83. +0 −117 accelerate-examples/tests/image-processing/Canny.hs
  84. +0 −49 accelerate-examples/tests/image-processing/IntegralImage.hs
  85. +0 −32 accelerate-examples/tests/image-processing/PGM.hs
  86. +0 −90 accelerate-examples/tests/io/BlockCopy.hs
  87. +0 −75 accelerate-examples/tests/io/Vector.hs
  88. +0 −81 accelerate-examples/tests/io/fill_with_values.cpp
  89. +0 −69 accelerate-examples/tests/primitives/Backpermute.hs
  90. +0 −84 accelerate-examples/tests/primitives/Fold.hs
  91. +0 −52 accelerate-examples/tests/primitives/Map.hs
  92. +0 −39 accelerate-examples/tests/primitives/Permute.hs
  93. +0 −58 accelerate-examples/tests/primitives/ScanSeg.hs
  94. +0 −229 accelerate-examples/tests/primitives/Stencil.hs
  95. +0 −70 accelerate-examples/tests/primitives/Stencil2.hs
  96. +0 −35 accelerate-examples/tests/primitives/Zip.hs
  97. +0 −42 accelerate-examples/tests/primitives/ZipWith.hs
  98. +0 −88 accelerate-examples/tests/simple/BlackScholes.hs
  99. +0 −44 accelerate-examples/tests/simple/DotP.hs
  100. +0 −55 accelerate-examples/tests/simple/Filter.hs
  101. +0 −86 accelerate-examples/tests/simple/Radix.hs
  102. +0 −35 accelerate-examples/tests/simple/SASUM.hs
  103. +0 −42 accelerate-examples/tests/simple/SAXPY.hs
  104. +0 −78 accelerate-examples/tests/simple/SMVM.hs
  105. +0 −75 accelerate-examples/tests/simple/SMVM/Matrix.hs
  106. +0 −133 accelerate-examples/tests/simple/SMVM/MatrixMarket.hs
  107. +0 −177 accelerate-examples/tests/simple/SharingRecovery.hs
  108. +0 −115 accelerate-examples/tests/simple/SliceExamples.hs
  109. +1 −0 accelerate-io
  110. +20 −130 accelerate.cabal
  111. +0 −67 cubits/Parse.hs
  112. +0 −22 cubits/accelerate_cuda_extras.h
  113. +0 −131 cubits/accelerate_cuda_function.h
  114. +0 −328 cubits/accelerate_cuda_shape.h
  115. +0 −91 cubits/accelerate_cuda_stencil.h
  116. +0 −132 cubits/accelerate_cuda_texture.h
  117. +0 −69 cubits/accelerate_cuda_util.h
  118. +0 −39 cubits/backpermute.inl
  119. +0 −97 cubits/fold.inl
  120. +0 −80 cubits/foldAll.inl
  121. +0 −132 cubits/foldSeg.inl
  122. +0 −32 cubits/generate.inl
  123. +0 −32 cubits/map.inl
  124. +0 −45 cubits/permute.inl
  125. +0 −72 cubits/reduce.inl
  126. +0 −33 cubits/replicate.inl
  127. +0 −23 cubits/scan.inl
  128. +0 −17 cubits/scan1.inl
  129. +0 −34 cubits/slice.inl
  130. +0 −33 cubits/stencil.inl
  131. +0 −36 cubits/stencil2.inl
  132. +0 −178 cubits/thrust/LICENSE
  133. +0 −38 cubits/thrust/NOTICE
  134. +0 −124 cubits/thrust/exclusive_scan.inl
  135. +0 −74 cubits/thrust/inclusive_scan.inl
  136. +0 −128 cubits/thrust/safe_scan_intervals.inl
  137. +0 −38 cubits/zipWith.inl
  138. +1 −6 utils/{Paths_accelerate.hs → Paths_accelerate_cuda.hs}
  139. +1 −2 utils/dot_ghci
View
@@ -2,3 +2,8 @@
/dist/
/accelerate-examples/dist
/accelerate-buildbot/dist
+/accelerate-cuda/dist/
+/accelerate-cuda/config.log
+/accelerate-cuda/config.status
+/accelerate-cuda/cubits/accelerate_cuda_shape.h
+/accelerate-io/dist/
View
@@ -0,0 +1,15 @@
+[submodule "accelerate-io"]
+ path = accelerate-io
+ url = git@github.com:AccelerateHS/accelerate-io.git
+[submodule "accelerate-buildbot"]
+ path = accelerate-buildbot
+ url = git@github.com:AccelerateHS/accelerate-buildbot.git
+[submodule "accelerate-examples"]
+ path = accelerate-examples
+ url = git@github.com:AccelerateHS/accelerate-examples.git
+[submodule "accelerate-cuda"]
+ path = accelerate-cuda
+ url = git@github.com:AccelerateHS/accelerate-cuda.git
+[submodule "accelerate-backend-kit"]
+ path = accelerate-backend-kit
+ url = git@github.com:mchakravarty/accelerate-backend-kit.git
View
@@ -38,7 +38,7 @@
module Data.Array.Accelerate (
-- * Scalar element types
- Int, Int8, Int16, Int32, Int64, Word, Word8, Word16, Word32, Word64,
+ Int, Int8, Int16, Int32, Int64, Word, Word8, Word16, Word32, Word64,
CShort, CUShort, CInt, CUInt, CLong, CULong, CLLong, CULLong,
Float, Double, CFloat, CDouble,
Bool, Char, CChar, CSChar, CUChar,
@@ -55,14 +55,14 @@ module Data.Array.Accelerate (
-- * Array shapes & indices
Z(..), (:.)(..), Shape, All(..), Any(..), Slice(..),
DIM0, DIM1, DIM2, DIM3, DIM4, DIM5, DIM6, DIM7, DIM8, DIM9,
-
+
-- * Operations to use Accelerate arrays from plain Haskell
arrayDim, arrayShape, arraySize, indexArray, fromIArray, toIArray, fromList, toList,
-- * The /Accelerate/ language
module Data.Array.Accelerate.Language,
module Data.Array.Accelerate.Prelude,
-
+
-- * Deprecated names for backwards compatibility
Elem, Ix, SliceIx, tuple, untuple,
@@ -1,6 +1,7 @@
{-# LANGUAGE BangPatterns, CPP, GADTs, DeriveDataTypeable, StandaloneDeriving #-}
{-# LANGUAGE FlexibleContexts, FlexibleInstances, TypeFamilies, TypeOperators #-}
{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances, ScopedTypeVariables #-}
+{-# OPTIONS_HADDOCK hide #-}
-- |
-- Module : Data.Array.Accelerate.AST
-- Copyright : [2008..2011] Manuel M T Chakravarty, Gabriele Keller, Sean Lee
@@ -320,18 +321,18 @@ data PreOpenAcc acc aenv a where
-> PreOpenAcc acc aenv (Array sh e)
-- Segmented fold along the innermost dimension of an array with a given /associative/ function
- FoldSeg :: (Shape sh, Elt e)
+ FoldSeg :: (Shape sh, Elt e, Elt i, IsIntegral i)
=> PreFun acc aenv (e -> e -> e) -- combination function
-> PreExp acc aenv e -- default value
-> acc aenv (Array (sh:.Int) e) -- folded array
- -> acc aenv Segments -- segment descriptor
+ -> acc aenv (Segments i) -- segment descriptor
-> PreOpenAcc acc aenv (Array (sh:.Int) e)
-- 'FoldSeg' without a default value
- Fold1Seg :: (Shape sh, Elt e)
+ Fold1Seg :: (Shape sh, Elt e, Elt i, IsIntegral i)
=> PreFun acc aenv (e -> e -> e) -- combination function
-> acc aenv (Array (sh:.Int) e) -- folded array
- -> acc aenv Segments -- segment descriptor
+ -> acc aenv (Segments i) -- segment descriptor
-> PreOpenAcc acc aenv (Array (sh:.Int) e)
-- Left-to-right Haskell-style scan of a linear array with a given *associative*
@@ -703,10 +704,9 @@ data PreOpenExp (acc :: * -> * -> *) env aenv t where
=> acc aenv (Array dim e)
-> PreOpenExp acc env aenv dim
- -- Number of elements of an array
- -- the array expression can not contain any free scalar variables
- Size :: (Shape dim, Elt e)
- => acc aenv (Array dim e)
+ -- Number of elements of an array given its shape
+ ShapeSize :: Shape dim
+ => PreOpenExp acc env aenv dim
-> PreOpenExp acc env aenv Int
-- |Vanilla open expression
@@ -1,4 +1,5 @@
{-# LANGUAGE ScopedTypeVariables, GADTs, RankNTypes #-}
+{-# OPTIONS_HADDOCK hide #-}
-- |
-- Module : Data.Array.Accelerate.Analysis.Shape
-- Copyright : [2008..2011] Manuel M T Chakravarty, Gabriele Keller, Sean Lee, Trevor L. McDonell
@@ -54,9 +55,9 @@ preAccDim k pacc =
Map _ acc -> k acc
ZipWith _ _ acc -> k acc
Fold _ _ acc -> k acc - 1
- FoldSeg _ _ _ acc -> k acc
Fold1 _ acc -> k acc - 1
- Fold1Seg _ _ acc -> k acc
+ FoldSeg _ _ acc _ -> k acc
+ Fold1Seg _ acc _ -> k acc
Scanl _ _ acc -> k acc
Scanl1 _ acc -> k acc
Scanr _ _ acc -> k acc
@@ -1,12 +1,13 @@
{-# LANGUAGE GADTs, ScopedTypeVariables #-}
+{-# OPTIONS_HADDOCK hide #-}
-- |
-- Module : Data.Array.Accelerate.CUDA.Analysis.Stencil
-- Copyright : [2010..2011] Ben Lever, Trevor L. McDonell
-- License : BSD3
--
-- Maintainer : Manuel M T Chakravarty <chak@cse.unsw.edu.au>
-- Stability : experimental
--- Portability : non-partable (GHC extensions)
+-- Portability : non-portable (GHC extensions)
--
module Data.Array.Accelerate.Analysis.Stencil (offsets, offsets2) where
@@ -17,7 +18,8 @@ import Data.Array.Accelerate.Array.Sugar
-- |Calculate the offset coordinates for each stencil element relative to the
-- focal point. The coordinates are returned as a flattened list from the
--- top-left element to the bottom-right.
+-- bottom-left element to the top-right. This ordering matches the Var indexing
+-- order.
--
offsets :: forall a b sh aenv stencil. Stencil sh a stencil
=> {- dummy -} Fun aenv (stencil -> b)
@@ -38,40 +40,40 @@ offsets2 _ _ _ =
-- |Position calculation on reified stencil values.
--
positionsR :: StencilR sh e pat -> [sh]
-positionsR StencilRunit3 = map (Z:.) [ -1, 0, 1 ]
-positionsR StencilRunit5 = map (Z:.) [ -2,-1, 0, 1, 2 ]
-positionsR StencilRunit7 = map (Z:.) [ -3,-2,-1, 0, 1, 2, 3 ]
-positionsR StencilRunit9 = map (Z:.) [-4,-3,-2,-1, 0, 1, 2, 3, 4]
+positionsR StencilRunit3 = map (Z:.) [ 1, 0,-1 ]
+positionsR StencilRunit5 = map (Z:.) [ 2, 1, 0,-1,-2 ]
+positionsR StencilRunit7 = map (Z:.) [ 3, 2, 1, 0,-1,-2,-3 ]
+positionsR StencilRunit9 = map (Z:.) [ 4, 3, 2, 1, 0,-1,-2,-3,-4 ]
-positionsR (StencilRtup3 a b c) = concat
- [ map (:.(-1)) $ positionsR a
+positionsR (StencilRtup3 c b a) = concat
+ [ map (:. 1 ) $ positionsR c
, map (:. 0 ) $ positionsR b
- , map (:. 1 ) $ positionsR c ]
+ , map (:.(-1)) $ positionsR a ]
-positionsR (StencilRtup5 a b c d e) = concat
- [ map (:.(-2)) $ positionsR a
- , map (:.(-1)) $ positionsR b
- , map (:. 0 ) $ positionsR c
+positionsR (StencilRtup5 e d c b a) = concat
+ [ map (:. 2 ) $ positionsR e
, map (:. 1 ) $ positionsR d
- , map (:. 2 ) $ positionsR e ]
+ , map (:. 0 ) $ positionsR c
+ , map (:.(-1)) $ positionsR b
+ , map (:.(-2)) $ positionsR a ]
-positionsR (StencilRtup7 a b c d e f g) = concat
- [ map (:.(-3)) $ positionsR a
- , map (:.(-2)) $ positionsR b
- , map (:.(-1)) $ positionsR c
- , map (:. 0 ) $ positionsR d
- , map (:. 1 ) $ positionsR e
+positionsR (StencilRtup7 g f e d c b a) = concat
+ [ map (:. 3 ) $ positionsR g
, map (:. 2 ) $ positionsR f
- , map (:. 3 ) $ positionsR g ]
+ , map (:. 1 ) $ positionsR e
+ , map (:. 0 ) $ positionsR d
+ , map (:.(-1)) $ positionsR c
+ , map (:.(-2)) $ positionsR b
+ , map (:.(-3)) $ positionsR a ]
-positionsR (StencilRtup9 a b c d e f g h i) = concat
- [ map (:.(-4)) $ positionsR a
- , map (:.(-3)) $ positionsR b
- , map (:.(-2)) $ positionsR c
- , map (:.(-1)) $ positionsR d
- , map (:. 0 ) $ positionsR e
- , map (:. 1 ) $ positionsR f
- , map (:. 2 ) $ positionsR g
+positionsR (StencilRtup9 i h g f e d c b a) = concat
+ [ map (:. 4 ) $ positionsR i
, map (:. 3 ) $ positionsR h
- , map (:. 4 ) $ positionsR i ]
+ , map (:. 2 ) $ positionsR g
+ , map (:. 1 ) $ positionsR f
+ , map (:. 0 ) $ positionsR e
+ , map (:.(-1)) $ positionsR d
+ , map (:.(-2)) $ positionsR c
+ , map (:.(-3)) $ positionsR b
+ , map (:.(-4)) $ positionsR a ]
@@ -1,5 +1,6 @@
{-# LANGUAGE RankNTypes, ScopedTypeVariables #-}
{-# LANGUAGE GADTs, TypeFamilies, PatternGuards #-}
+{-# OPTIONS_HADDOCK hide #-}
-- |
-- Module : Data.Array.Accelerate.Analysis.Type
-- Copyright : [2009..2011] Manuel M T Chakravarty, Gabriele Keller, Sean Lee, Trevor L. McDonell
@@ -163,7 +164,7 @@ preExpType k e =
PrimApp _ _ -> eltType (undefined::t)
IndexScalar acc _ -> k acc
Shape _ -> eltType (undefined::t)
- Size _ -> eltType (undefined::t)
+ ShapeSize _ -> eltType (undefined::t)
-- |Reify the result type of a tuple projection.
--
@@ -1,6 +1,7 @@
{-# LANGUAGE CPP, GADTs, TypeFamilies, FlexibleContexts, FlexibleInstances #-}
-{-# LANGUAGE RankNTypes, MagicHash, UnboxedTuples #-}
+{-# LANGUAGE RankNTypes, MagicHash, UnboxedTuples, ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-missing-methods #-}
+{-# OPTIONS_HADDOCK hide #-}
-- |
-- Module : Data.Array.Accelerate.Array.Data
-- Copyright : [2009..2011] Manuel M T Chakravarty, Gabriele Keller, Sean Lee
@@ -34,6 +35,7 @@ import GHC.Prim (newPinnedByteArray#, byteArrayContents#,
unsafeFreezeByteArray#, Int#, (*#))
import GHC.Ptr (Ptr(Ptr))
import GHC.ST (ST(ST))
+import Data.Typeable
import Control.Monad
import Control.Monad.ST
import qualified Data.Array.IArray as IArray
@@ -98,6 +100,11 @@ data instance GArrayData ba Char = AD_Char (ba Char)
data instance GArrayData ba (a, b) = AD_Pair (GArrayData ba a)
(GArrayData ba b)
+instance (Typeable1 ba, Typeable e) => Typeable (GArrayData ba e) where
+ typeOf _ = myMkTyCon "Data.Array.Accelerate.Array.Data.GArrayData"
+ `mkTyConApp` [typeOf (undefined::ba e), typeOf (undefined::e)]
+
+
-- | GADT to reify the 'ArrayElt' class.
--
data ArrayEltR a where
@@ -1,5 +1,6 @@
{-# LANGUAGE CPP, GADTs, FlexibleContexts, FlexibleInstances #-}
{-# LANGUAGE TypeOperators, TypeFamilies #-}
+{-# OPTIONS_HADDOCK hide #-}
-- |
-- Module : Data.Array.Accelerate.Array.Representation
-- Copyright : [2008..2011] Manuel M T Chakravarty, Gabriele Keller, Sean Lee, Trevor L. McDonell
@@ -54,7 +55,7 @@ class (Eq sh, Slice sh) => Shape sh where
rangeToShape :: (sh, sh) -> sh -- convert a minpoint-maxpoint index
-- into a shape
shapeToRange :: sh -> (sh, sh) -- ...the converse
-
+
-- other conversions
shapeToList :: sh -> [Int] -- convert a shape into its list of dimensions
@@ -63,14 +64,14 @@ class (Eq sh, Slice sh) => Shape sh where
instance Shape () where
dim () = 0
size () = 1
-
+
() `intersect` () = ()
ignore = ()
index () () = 0
bound () () _ = Right ()
- iter () f c e = e `c` f ()
+ iter () f _ _ = f ()
iter1 () f _ = f ()
-
+
rangeToShape ((), ()) = ()
shapeToRange () = ((), ())
@@ -81,11 +82,12 @@ instance Shape () where
instance Shape sh => Shape (sh, Int) where
dim (sh, _) = dim sh + 1
size (sh, sz) = size sh * sz
-
+
(sh1, sz1) `intersect` (sh2, sz2) = (sh1 `intersect` sh2, sz1 `min` sz2)
ignore = (ignore, -1)
index (sh, sz) (ix, i) = BOUNDS_CHECK(checkIndex) "index" i sz
$ index sh ix * sz + i
+
bound (sh, sz) (ix, i) bndy
| i < 0 = case bndy of
Clamp -> bound sh ix bndy `addDim` 0
Oops, something went wrong.

0 comments on commit 85dd683

Please sign in to comment.