compSharedCopy :: PrimType a => String
               -> DSArr a -> Arr (Data a)
               -> Data Index -> IndexRange -> RunGen ()
compSharedCopy op spm ram offset (lower, upper) = do
    shmRef <- gets $ shmRefForName $ arrayRefName spm
    lift $ addInclude "<feldspar-parallella.h>"
    lift $ callProc op
        [ shmRef
        , arrArg ram
        , valArg offset
        , valArg lower
        , valArg upper
        ]


--------------------------------------------------------------------------------
-- Halting cores
--------------------------------------------------------------------------------
compSharedCopy :: PrimType a => String
               -> DSArr a -> Arr (Data a)
               -> Data Index -> IndexRange -> RunGen ()
compSharedCopy op spm ram offset (lower, upper) = do
    shmRef <- gets $ shmRefForName $ arrayRefName spm
    lift $ addInclude "<feldspar-parallella.h>"
    lift $ callProc op
        [ shmRef
        , arrArg ram
        , valArg offset
        , valArg lower
        , valArg upper
        ]


--------------------------------------------------------------------------------
-- Halting cores
--------------------------------------------------------------------------------
compSharedCopy op spm ram offset (lower, upper) = do
    shmRef <- gets $ shmRefForName $ arrayRefName spm
    lift $ addInclude "<feldspar-parallella.h>"
    lift $ callProc op
        [ shmRef
        , arrArg ram
        , valArg offset
        , valArg lower
        , valArg upper
        ]


--------------------------------------------------------------------------------
-- Halting cores
--------------------------------------------------------------------------------