#include "fusion-phases.h"
module Data.Array.Parallel.Unlifted.Sequential.Segmented.Basics (
replicateSU, replicateRSU, appendSU
) where
import Data.Array.Parallel.Stream
import Data.Array.Parallel.Unlifted.Sequential.Flat
import Data.Array.Parallel.Unlifted.Sequential.Segmented.USegd
replicateSU :: UA a => USegd -> UArr a -> UArr a
replicateSU segd xs = unstreamU
(replicateEachS (elementsUSegd segd)
(zipS (streamU (lengthsUSegd segd)) (streamU xs)))
replicateRSU :: UA a => Int -> UArr a -> UArr a
replicateRSU n xs = unstreamU
. replicateEachRS n
$ streamU xs
appendSU :: UA a => USegd -> UArr a -> USegd -> UArr a -> UArr a
appendSU xd xs yd ys = unstreamU
$ appendSS (streamU (lengthsUSegd xd))
(streamU xs)
(streamU (lengthsUSegd yd))
(streamU ys)