@@ -10,9 +10,7 @@
10{-# LANGUAGE ScopedTypeVariables #-}
10{-# LANGUAGE ScopedTypeVariables #-}
14-- DATA_ARRAY
13-- DATA_ARRAY
15−-- DATA_ARRAY_PRIM_PINNED
17module Streamly.Benchmark.Data.ArrayOps where
15module Streamly.Benchmark.Data.ArrayOps where
@@ -22,18 +20,13 @@ import Prelude (Bool, Int, Maybe(..), ($), (+), (.), (==), (>), undefined)
22import qualified Prelude as P
20import qualified Prelude as P
23import qualified Streamly.Prelude as S
21import qualified Streamly.Prelude as S
25−#if !defined(DATA_ARRAY_PRIM_PINNED)
26#ifdef DEVBUILD
23#ifdef DEVBUILD
28import qualified Data.Foldable as F
25import qualified Data.Foldable as F
33−#if defined(DATA_ARRAY_PRIM_PINNED)
34−import qualified Streamly.Internal.Data.Array.Prim.Pinned as A
36−#elif defined(DATA_ARRAY)
29+#if defined(DATA_ARRAY)
37import qualified Streamly.Internal.Data.Array as A
30import qualified Streamly.Internal.Data.Array as A
38type Stream = A.Array
31type Stream = A.Array
@@ -49,7 +42,6 @@ type Stream = A.Array
49-------------------------------------------------------------------------------
42-------------------------------------------------------------------------------
50-- CPP Common to:
43-- CPP Common to:
51-- DATA_ARRAY
44-- DATA_ARRAY
52−-- DATA_ARRAY_PRIM_PINNED
53-------------------------------------------------------------------------------
45-------------------------------------------------------------------------------
55{-# INLINE sourceUnfoldr #-}
47{-# INLINE sourceUnfoldr #-}
@@ -77,7 +69,6 @@ sourceIntFromToFromList value n = P.return $ A.fromList $ [n..n + value]
77-------------------------------------------------------------------------------
69-------------------------------------------------------------------------------
78-- CPP Common to:
70-- CPP Common to:
79-- DATA_ARRAY
71-- DATA_ARRAY
80−-- DATA_ARRAY_PRIM_PINNED
81-------------------------------------------------------------------------------
72-------------------------------------------------------------------------------
@@ -92,7 +83,6 @@ sourceIntFromToFromStream value n = S.fold A.write $ S.enumerateFromTo n (n + va
92-------------------------------------------------------------------------------
83-------------------------------------------------------------------------------
93-- CPP Common to:
84-- CPP Common to:
94-- DATA_ARRAY
85-- DATA_ARRAY
95−-- DATA_ARRAY_PRIM_PINNED
96-------------------------------------------------------------------------------
86-------------------------------------------------------------------------------
98{-# INLINE composeN #-}
88{-# INLINE composeN #-}
@@ -156,7 +146,6 @@ pureFoldl' = S.foldl' (+) 0 . S.unfold A.read
156-------------------------------------------------------------------------------
146-------------------------------------------------------------------------------
159−#if !defined(DATA_ARRAY_PRIM_PINNED)
160{-# INLINE readInstance #-}
149{-# INLINE readInstance #-}
161readInstance :: P.String -> Stream Int
150readInstance :: P.String -> Stream Int
162readInstance str =
151readInstance str =
@@ -176,7 +165,6 @@ foldableSum :: Stream Int -> Int
176foldableSum = P.sum
165foldableSum = P.sum
181-------------------------------------------------------------------------------
169-------------------------------------------------------------------------------
182-- Elimination
170-- Elimination
@@ -185,7 +173,6 @@ foldableSum = P.sum
185-------------------------------------------------------------------------------
173-------------------------------------------------------------------------------
186-- CPP Common to:
174-- CPP Common to:
187-- DATA_ARRAY
175-- DATA_ARRAY
188−-- DATA_ARRAY_PRIM_PINNED
189-------------------------------------------------------------------------------
176-------------------------------------------------------------------------------
191{-# INLINE unfoldReadDrain #-}
178{-# INLINE unfoldReadDrain #-}