1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
module Data.Array.Repa.Eval.Load
( Load (..)
, LoadRange (..))
where
import Data.Array.Repa.Eval.Target
import Data.Array.Repa.Shape
import Data.Array.Repa.Base
-- Load -----------------------------------------------------------------------
-- | Compute all elements defined by an array and write them to a manifest
-- target representation.
--
-- Note that instances require that the source array to have a delayed
-- representation such as `D` or `C`. If you want to use a pre-existing
-- manifest array as the source then `delay` it first.
class (Source r1 e, Shape sh) => Load r1 sh e where
-- | Fill an entire array sequentially.
loadS :: Target r2 e => Array r1 sh e -> MVec r2 e -> IO ()
-- | Fill an entire array in parallel.
loadP :: Target r2 e => Array r1 sh e -> MVec r2 e -> IO ()
-- FillRange ------------------------------------------------------------------
-- | Compute a range of elements defined by an array and write them to a fillable
-- representation.
class (Source r1 e, Shape sh) => LoadRange r1 sh e where
-- | Fill a range of an array sequentially.
loadRangeS :: Target r2 e => Array r1 sh e -> MVec r2 e -> sh -> sh -> IO ()
-- | Fill a range of an array in parallel.
loadRangeP :: Target r2 e => Array r1 sh e -> MVec r2 e -> sh -> sh -> IO ()
|