@@ -12,7 +12,6 @@
13-- MEMORY_ARRAY
13-- MEMORY_ARRAY
14-- DATA_ARRAY
14-- DATA_ARRAY
16-- DATA_ARRAY_PRIM_PINNED
15-- DATA_ARRAY_PRIM_PINNED
18module Streamly.Benchmark.Data.ArrayOps where
17module Streamly.Benchmark.Data.ArrayOps where
@@ -23,7 +22,7 @@ import Prelude (Bool, Int, Maybe(..), ($), (+), (.), (==), (>), undefined)
23import qualified Prelude as P
22import qualified Prelude as P
24import qualified Streamly.Prelude as S
23import qualified Streamly.Prelude as S
26−#if !defined(DATA_ARRAY_PRIM) && !defined(DATA_ARRAY_PRIM_PINNED)
25+#if !defined(DATA_ARRAY_PRIM_PINNED)
27#ifdef DEVBUILD
26#ifdef DEVBUILD
29import qualified Data.Foldable as F
28import qualified Data.Foldable as F
@@ -31,10 +30,7 @@ import qualified Data.Foldable as F
34−#if defined(DATA_ARRAY_PRIM)
35−import qualified Streamly.Internal.Data.Array.Prim as A
37−#elif defined(DATA_ARRAY_PRIM_PINNED)
33+#if defined(DATA_ARRAY_PRIM_PINNED)
38import qualified Streamly.Internal.Data.Array.Prim.Pinned as A
34import qualified Streamly.Internal.Data.Array.Prim.Pinned as A
39type Stream = A.Array
35type Stream = A.Array
40#elif defined(DATA_ARRAY)
36#elif defined(DATA_ARRAY)
@@ -53,7 +49,6 @@ type Stream = A.Array
53-------------------------------------------------------------------------------
49-------------------------------------------------------------------------------
54-- CPP Common to:
50-- CPP Common to:
55-- DATA_ARRAY
51-- DATA_ARRAY
57-- DATA_ARRAY_PRIM_PINNED
52-- DATA_ARRAY_PRIM_PINNED
58-------------------------------------------------------------------------------
53-------------------------------------------------------------------------------
@@ -82,7 +77,6 @@ sourceIntFromToFromList value n = P.return $ A.fromList $ [n..n + value]
82-------------------------------------------------------------------------------
77-------------------------------------------------------------------------------
83-- CPP Common to:
78-- CPP Common to:
84-- DATA_ARRAY
79-- DATA_ARRAY
86-- DATA_ARRAY_PRIM_PINNED
80-- DATA_ARRAY_PRIM_PINNED
87-------------------------------------------------------------------------------
81-------------------------------------------------------------------------------
@@ -98,7 +92,6 @@ sourceIntFromToFromStream value n = S.fold A.write $ S.enumerateFromTo n (n + va
98-------------------------------------------------------------------------------
92-------------------------------------------------------------------------------
99-- CPP Common to:
93-- CPP Common to:
100-- DATA_ARRAY
94-- DATA_ARRAY
102-- DATA_ARRAY_PRIM_PINNED
95-- DATA_ARRAY_PRIM_PINNED
103-------------------------------------------------------------------------------
96-------------------------------------------------------------------------------
@@ -163,7 +156,7 @@ pureFoldl' = S.foldl' (+) 0 . S.unfold A.read
163-------------------------------------------------------------------------------
156-------------------------------------------------------------------------------
166−#if !defined(DATA_ARRAY_PRIM) && !defined(DATA_ARRAY_PRIM_PINNED)
159+#if !defined(DATA_ARRAY_PRIM_PINNED)
167{-# INLINE readInstance #-}
160{-# INLINE readInstance #-}
168readInstance :: P.String -> Stream Int
161readInstance :: P.String -> Stream Int
169readInstance str =
162readInstance str =
@@ -192,7 +185,6 @@ foldableSum = P.sum
192-------------------------------------------------------------------------------
185-------------------------------------------------------------------------------
193-- CPP Common to:
186-- CPP Common to:
194-- DATA_ARRAY
187-- DATA_ARRAY
196-- DATA_ARRAY_PRIM_PINNED
188-- DATA_ARRAY_PRIM_PINNED
197-------------------------------------------------------------------------------
189-------------------------------------------------------------------------------