massiv 0.1.1.0 → 0.1.2.0
raw patch · 8 files changed
+29/−19 lines, 8 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- massiv.cabal +1/−1
- src/Data/Massiv/Array/Delayed/Internal.hs +1/−1
- src/Data/Massiv/Array/Manifest/Primitive.hs +3/−5
- src/Data/Massiv/Array/Mutable.hs +1/−1
- src/Data/Massiv/Core/Computation.hs +10/−0
- src/Data/Massiv/Core/Index.hs +7/−7
- src/Data/Massiv/Core/Index/Ix.hs +1/−1
- tests/Data/Massiv/Core/SchedulerSpec.hs +5/−3
massiv.cabal view
@@ -1,5 +1,5 @@ name: massiv-version: 0.1.1.0+version: 0.1.2.0 synopsis: Massiv (Массив) is an Array Library. description: Multi-dimensional Arrays with fusion, stencils and parallel computation. homepage: https://github.com/lehins/massiv
src/Data/Massiv/Array/Delayed/Internal.hs view
@@ -114,7 +114,7 @@ {-# INLINE (<*>) #-} --- | Row-major sequential folding over a delayed array.+-- | Row-major sequential folding over a Delayed array. instance Index ix => Foldable (Array D ix) where foldl = lazyFoldlS {-# INLINE foldl #-}
src/Data/Massiv/Array/Manifest/Primitive.hs view
@@ -34,12 +34,10 @@ import Data.Massiv.Core.List import Data.Primitive (sizeOf) import Data.Primitive.ByteArray-import Data.Primitive.Types (Prim) import Data.Primitive.Types import qualified Data.Vector.Primitive as VP-import GHC.Base (unsafeCoerce#)+import GHC.Base (Int(..)) import GHC.Exts as GHC (IsList (..))-import GHC.Int (Int (..)) import GHC.Prim import Prelude hiding (mapM) @@ -172,7 +170,7 @@ unsafeNewA sz (State s#) = let kb# = totalSize# sz (undefined :: e)- (# s'#, mba# #) = newByteArray# kb# s# in+ !(# s'#, mba# #) = newByteArray# kb# s# in pure (State s'#, MPArray sz (MutableByteArray mba#)) {-# INLINE unsafeNewA #-} @@ -181,7 +179,7 @@ {-# INLINE unsafeThawA #-} unsafeFreezeA comp (MPArray sz (MutableByteArray mba#)) (State s#) =- let (# s'#, ba# #) = unsafeFreezeByteArray# mba# s# in+ let !(# s'#, ba# #) = unsafeFreezeByteArray# mba# s# in pure (State s'#, PArray comp sz (ByteArray ba#)) {-# INLINE unsafeFreezeA #-}
src/Data/Massiv/Array/Mutable.hs view
@@ -48,7 +48,7 @@ import Data.Massiv.Array.Manifest.Internal import Data.Massiv.Array.Unsafe import Data.Massiv.Core.Common-import GHC.Int (Int (..))+import GHC.Base (Int (..)) import GHC.Prim -- errorSizeMismatch fName sz1 sz2 =
src/Data/Massiv/Core/Computation.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE ScopedTypeVariables #-} -- |@@ -14,6 +15,15 @@ ) where import Control.DeepSeq (NFData (..), deepseq)+#if MIN_VERSION_base(4,9,0)+import Data.Semigroup++instance Semigroup Comp where+ (<>) = joinComp++#endif++ -- | Computation type to use. data Comp
src/Data/Massiv/Core/Index.hs view
@@ -37,41 +37,41 @@ -- | Approach to be used near the borders during various transformations. -- Whenever a function needs information not only about an element of interest, but--- also about it's neighbours, it will go out of bounds around the image edges,--- hence is this set of approaches that can be used in such situtation.+-- also about it's neighbors, it will go out of bounds near the array edges,+-- hence is this set of approaches that specify how to handle such situation. data Border e = Fill e -- ^ Fill in a constant element. -- -- @- -- outside | Image | outside+ -- outside | Array | outside -- ('Fill' 0) : 0 0 0 0 | 1 2 3 4 | 0 0 0 0 -- @ -- | Wrap -- ^ Wrap around from the opposite border of the array. -- -- @- -- outside | Image | outside+ -- outside | Array | outside -- 'Wrap' : 1 2 3 4 | 1 2 3 4 | 1 2 3 4 -- @ -- | Edge -- ^ Replicate the element at the edge. -- -- @- -- outside | Image | outside+ -- outside | Array | outside -- 'Edge' : 1 1 1 1 | 1 2 3 4 | 4 4 4 4 -- @ -- | Reflect -- ^ Mirror like reflection. -- -- @- -- outside | Image | outside+ -- outside | Array | outside -- 'Reflect' : 4 3 2 1 | 1 2 3 4 | 4 3 2 1 -- @ -- | Continue -- ^ Also mirror like reflection, but without repeating the edge element. -- -- @- -- outside | Image | outside+ -- outside | Array | outside -- 'Continue' : 1 4 3 2 | 1 2 3 4 | 3 2 1 4 -- @ --
src/Data/Massiv/Core/Index/Ix.hs view
@@ -83,7 +83,7 @@ data IxN (n :: Nat) where (:>) :: {-# UNPACK #-} !Int -> !(Ix (n - 1)) -> IxN n --- | Define n-dimensional index by relating a general `IxN` with two few cases.+-- | Defines n-dimensional index by relating a general `IxN` with few base cases. type family Ix (n :: Nat) = r | r -> n where Ix 0 = Ix0 Ix 1 = Ix1
tests/Data/Massiv/Core/SchedulerSpec.hs view
@@ -28,8 +28,8 @@ (setComp (ParOn caps) arr)) -- | Ensure proper exception handling in nested parallel computation-prop_CatchNested :: ArrIx D Ix1 (ArrIxP D Ix1 Int) -> [Int] -> Property-prop_CatchNested (ArrIx arr ix) caps =+_prop_CatchNested :: ArrIx D Ix1 (ArrIxP D Ix1 Int) -> [Int] -> Property+_prop_CatchNested (ArrIx arr ix) caps = assertException (== DivideByZero) (computeAs U $@@ -73,6 +73,8 @@ spec = do describe "Exceptions" $ do it "CatchDivideByZero" $ property prop_CatchDivideByZero- it "CatchNested" $ property prop_CatchNested+ it "CatchNested" $ do+ pendingWith "Behaves weirdly with GHC 7.10 and whenever executed with --coverage"+ --property prop_CatchNested it "AllWorkersDied" $ property prop_AllWorkersDied it "SchedulerAllJobsProcessed" $ property prop_SchedulerAllJobsProcessed