repa 2.0.0.4 → 2.0.1.1
raw patch · 2 files changed
+88/−20 lines, 2 files
Files
- Data/Array/Repa/Internals/Elt.hs +83/−15
- repa.cabal +5/−5
Data/Array/Repa/Internals/Elt.hs view
@@ -15,10 +15,14 @@ -- values. The argument type has kind ?, not just * or #. -- | Element types that can be stored in Repa arrays.+-- Repa uses `Data.Vector.Unboxed` to store the actual data. The implementation+-- of this library is based on type families and picks an efficient, specialised+-- representation for every element type. In particular, unboxed vectors of pairs+-- are represented as pairs of unboxed vectors. class (Show a, Unbox a) => Elt a where -- | We use this to prevent bindings from being floated inappropriatey.- -- Doing a `seq` sometimes isn't enough, because the GHC simpplifier can + -- Doing a `seq` sometimes isn't enough, because the GHC simplifier can -- erase these, and/or still move around the bindings. touch :: a -> IO () @@ -43,20 +47,6 @@ one = True --- Tuple -----------------------------------------------------------------------instance (Elt a, Elt b) => Elt (a, b) where- {-# INLINE touch #-}- touch (a, b) - = do touch a- touch b- - {-# INLINE zero #-}- zero = (zero, zero)-- {-# INLINE one #-}- one = (one, one)-- -- Floating ------------------------------------------------------------------- instance Elt Float where {-# INLINE touch #-}@@ -161,3 +151,81 @@ {-# INLINE one #-} one = 1+++-- Tuple ----------------------------------------------------------------------+instance (Elt a, Elt b) => Elt (a, b) where+ {-# INLINE touch #-}+ touch (a, b) + = do touch a+ touch b+ + {-# INLINE zero #-}+ zero = (zero, zero)++ {-# INLINE one #-}+ one = (one, one)+++instance (Elt a, Elt b, Elt c) => Elt (a, b, c) where+ {-# INLINE touch #-}+ touch (a, b, c) + = do touch a+ touch b+ touch c+ + {-# INLINE zero #-}+ zero = (zero, zero, zero)++ {-# INLINE one #-}+ one = (one, one, one)+++instance (Elt a, Elt b, Elt c, Elt d) => Elt (a, b, c, d) where+ {-# INLINE touch #-}+ touch (a, b, c, d) + = do touch a+ touch b+ touch c+ touch d+ + {-# INLINE zero #-}+ zero = (zero, zero, zero, zero)++ {-# INLINE one #-}+ one = (one, one, one, one)+++instance (Elt a, Elt b, Elt c, Elt d, Elt e) => Elt (a, b, c, d, e) where+ {-# INLINE touch #-}+ touch (a, b, c, d, e) + = do touch a+ touch b+ touch c+ touch d+ touch e+ + {-# INLINE zero #-}+ zero = (zero, zero, zero, zero, zero)++ {-# INLINE one #-}+ one = (one, one, one, one, one)+++instance (Elt a, Elt b, Elt c, Elt d, Elt e, Elt f) => Elt (a, b, c, d, e, f) where+ {-# INLINE touch #-}+ touch (a, b, c, d, e, f) + = do touch a+ touch b+ touch c+ touch d+ touch e+ touch f+ + {-# INLINE zero #-}+ zero = (zero, zero, zero, zero, zero, zero)++ {-# INLINE one #-}+ one = (one, one, one, one, one, one)++
repa.cabal view
@@ -1,5 +1,5 @@ Name: repa-Version: 2.0.0.4+Version: 2.0.1.1 License: BSD3 License-file: LICENSE Author: The DPH Team@@ -11,10 +11,10 @@ Homepage: http://repa.ouroborus.net Bug-reports: repa@ouroborus.net Description:- Repa provides high performance, regular, multi-dimensional, shape polymorphic parallel arrays.- All numeric data is stored unboxed. Functions written with the Repa combinators- are automatically parallel provided you supply +RTS -Nwhatever on the command- line when running the program.+ Repa provides high performance, regular, multi-dimensional, shape polymorphic+ parallel arrays. All numeric data is stored unboxed. Functions written with+ the Repa combinators are automatically parallel provided you supply+ +RTS -Nwhatever on the command line when running the program. Synopsis: High performance, regular, shape polymorphic parallel arrays.