packages feed

repa 3.1.0.1 → 3.1.1.1

raw patch · 5 files changed

+96/−7 lines, 5 filesdep ~basePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: base

API changes (from Hackage documentation)

+ Data.Array.Repa.Operators.Mapping: instance Combine r1 a r2 b => Combine (S r1) a (S r2) b
+ Data.Array.Repa.Repr.Hint: data S r1
+ Data.Array.Repa.Repr.Hint: hintSmall :: Array r1 sh e -> Array (S r1) sh e
+ Data.Array.Repa.Repr.Hint: instance (Shape sh, Fill r1 r2 sh e) => Fill (S r1) r2 sh e
+ Data.Array.Repa.Repr.Hint: instance (Shape sh, FillRange r1 r2 sh e) => FillRange (S r1) r2 sh e
+ Data.Array.Repa.Repr.Hint: instance Repr r1 a => Repr (S r1) a
- Data.Array.Repa.Stencil.Dim2: type PC5 = P C (P D (P D (P D (P D X))))
+ Data.Array.Repa.Stencil.Dim2: type PC5 = P C (P (S D) (P (S D) (P (S D) (P (S D) X))))

Files

Data/Array/Repa.hs view
@@ -1,4 +1,4 @@-+{-# OPTIONS -fno-warn-unused-imports #-} -- | Repa arrays are wrappers around a linear structure that holds the element --   data. The representation tag determines what structure holds the data. --@@ -22,6 +22,9 @@ -- --   * `P`  -- Arrays that are partitioned into several representations. --+--   * `S`  -- Hints that computing this array is a small amount of work that should+--             not be done in parallel.+--  --   * `X`  -- Arrays whose elements are all undefined. -- --  Array fusion is achieved via the delayed (`D`) and cursored (`C`)@@ -163,9 +166,11 @@ import Data.Array.Repa.Repr.Unboxed import Data.Array.Repa.Repr.ByteString import Data.Array.Repa.Repr.ForeignPtr+import Data.Array.Repa.Repr.Hint import Data.Array.Repa.Repr.Cursored import Data.Array.Repa.Repr.Partitioned import Data.Array.Repa.Repr.Undefined           ()+import Data.Array.Repa.Repr.Hint import Data.Array.Repa.Operators.Mapping import Data.Array.Repa.Operators.Traversal import Data.Array.Repa.Operators.IndexSpace
Data/Array/Repa/Operators/Mapping.hs view
@@ -15,6 +15,7 @@ import Data.Array.Repa.Repr.Cursored import Data.Array.Repa.Repr.Delayed import Data.Array.Repa.Repr.ForeignPtr+import Data.Array.Repa.Repr.Hint import Data.Array.Repa.Repr.Partitioned import Data.Array.Repa.Repr.Unboxed import Data.Array.Repa.Repr.Undefined@@ -149,14 +150,26 @@         , Combine r12 a r22 b)        => Combine (P r11 r12) a (P r21 r22) b where - {-# INLINE [3] cmap #-}  cmap f (APart sh range arr1 arr2)         = APart sh range (cmap f arr1) (cmap f arr2)+ {-# INLINE [3] cmap #-} - {-# INLINE [2] czipWith #-}  czipWith f arr1 (APart sh range arr21 arr22)         = APart sh range (czipWith f arr1 arr21)                          (czipWith f arr1 arr22)+ {-# INLINE [2] czipWith #-}+++-- Small ------------------------------+instance   Combine r1 a r2 b+        => Combine (S r1) a (S r2) b where+ cmap f (ASmall arr1)+        = ASmall (cmap f arr1)+ {-# INLINE [3] cmap #-}++ czipWith f arr1 (ASmall arr2)+        = ASmall (czipWith f arr1 arr2)+ {-# INLINE [3] czipWith #-}   -- Unboxed ----------------------------
+ Data/Array/Repa/Repr/Hint.hs view
@@ -0,0 +1,69 @@++module Data.Array.Repa.Repr.Hint+        (S, Array (..), hintSmall)+where+import Data.Array.Repa.Base+import Data.Array.Repa.Eval.Fill+import Data.Array.Repa.Shape++-- | Hints that evaluating this array is only a small amount of work.+--   It will be evaluated sequentially in the main thread, instead of+--   in parallel on the gang. This avoids the associated scheduling overhead.+data S r1++data instance Array (S r1) sh e+        = ASmall !(Array r1 sh e)++-- | Wrap an array with a smallness hint.+hintSmall :: Array r1 sh e -> Array (S r1) sh e+hintSmall = ASmall+++instance Repr r1 a => Repr (S r1) a where+ extent (ASmall arr) +        = extent arr+ {-# INLINE extent #-}++ index  (ASmall arr) ix+        = index arr ix+ {-# INLINE index #-}++ unsafeIndex (ASmall arr) ix+        = unsafeIndex arr ix+ {-# INLINE unsafeIndex #-}++ linearIndex (ASmall arr) ix+        = linearIndex arr ix+ {-# INLINE linearIndex #-}++ unsafeLinearIndex (ASmall arr) ix+        = unsafeLinearIndex arr ix+ {-# INLINE unsafeLinearIndex #-}++ deepSeqArray (ASmall arr) x+        = deepSeqArray arr x+ {-# INLINE deepSeqArray #-}+++-- Fill -----------------------------------------------------------------------+instance ( Shape sh, Fill r1 r2 sh e) +        => Fill (S r1) r2 sh e where+ fillP (ASmall arr) marr+  = fillS arr marr+ {-# INLINE fillP #-}++ fillS (ASmall arr) marr+  = fillS arr marr+ {-# INLINE fillS #-}+++-- FillRange ------------------------------------------------------------------+instance ( Shape sh, FillRange r1 r2 sh e)+        => FillRange (S r1) r2 sh e where+ fillRangeP (ASmall arr) marr ix1 ix2+  = fillRangeS arr marr ix1 ix2+ {-# INLINE fillRangeP #-}++ fillRangeS (ASmall arr) marr ix1 ix2+  = fillRangeS arr marr ix1 ix2+ {-# INLINE fillRangeS #-}
Data/Array/Repa/Stencil/Dim2.hs view
@@ -21,6 +21,7 @@ import Data.Array.Repa import Data.Array.Repa.Repr.Cursored import Data.Array.Repa.Repr.Partitioned+import Data.Array.Repa.Repr.Hint import Data.Array.Repa.Repr.Undefined import Data.Array.Repa.Stencil.Base import Data.Array.Repa.Stencil.Template@@ -31,7 +32,7 @@ data Cursor 	= Cursor Int -type PC5 = P C (P D (P D (P D (P D X))))+type PC5 = P C (P (S D) (P (S D) (P (S D) (P (S D) X))))   -- Wrappers -------------------------------------------------------------------@@ -106,7 +107,7 @@         arrInternal     = makeCursored (extent arr) makec shiftc getInner'                   {-# INLINE arrBorder #-}-        arrBorder       = fromFunction (extent arr) getBorder'+        arrBorder       = ASmall (fromFunction (extent arr) getBorder')     in     --  internal region
repa.cabal view
@@ -1,5 +1,5 @@ Name:                repa-Version:             3.1.0.1+Version:             3.1.1.1 License:             BSD3 License-file:        LICENSE Author:              The DPH Team@@ -23,7 +23,7 @@  Library   Build-Depends: -        base                 == 4.5.*,+        base                 == 4.*,         ghc-prim             == 0.2.*,         vector               == 0.9.*,         bytestring           == 0.9.*,@@ -61,6 +61,7 @@         Data.Array.Repa.Repr.Cursored         Data.Array.Repa.Repr.Delayed         Data.Array.Repa.Repr.ForeignPtr+        Data.Array.Repa.Repr.Hint         Data.Array.Repa.Repr.Partitioned         Data.Array.Repa.Repr.Unboxed         Data.Array.Repa.Repr.Undefined