compLocalCopy :: PrimType a => String
              -> DLArr a -> Arr (Data a)
              -> Data Index -> IndexRange -> RunGen ()
compLocalCopy op spm ram offset (lower, upper) = do
    groupAddr <- gets group
    (r, c) <- gets $ groupCoordsForName (arrayRefName spm)
    lift $ addInclude "<feldspar-parallella.h>"
    lift $ callProc op
        [ groupAddr
        , valArg $ value r
        , valArg $ value c
        , arrArg (unwrapArr spm)
        , arrArg ram
        , valArg offset
        , valArg lower
        , valArg upper
        ]


--------------------------------------------------------------------------------
-- Shared array fetch and flush
--------------------------------------------------------------------------------
compLocalCopy :: PrimType a => String
              -> DLArr a -> Arr (Data a)
              -> Data Index -> IndexRange -> RunGen ()
compLocalCopy op spm ram offset (lower, upper) = do
    groupAddr <- gets group
    (r, c) <- gets $ groupCoordsForName (arrayRefName spm)
    lift $ addInclude "<feldspar-parallella.h>"
    lift $ callProc op
        [ groupAddr
        , valArg $ value r
        , valArg $ value c
        , arrArg (unwrapArr spm)
        , arrArg ram
        , valArg offset
        , valArg lower
        , valArg upper
        ]


--------------------------------------------------------------------------------
-- Shared array fetch and flush
--------------------------------------------------------------------------------
compLocalCopy op spm ram offset (lower, upper) = do
    groupAddr <- gets group
    (r, c) <- gets $ groupCoordsForName (arrayRefName spm)
    lift $ addInclude "<feldspar-parallella.h>"
    lift $ callProc op
        [ groupAddr
        , valArg $ value r
        , valArg $ value c
        , arrArg (unwrapArr spm)
        , arrArg ram
        , valArg offset
        , valArg lower
        , valArg upper
        ]


--------------------------------------------------------------------------------
-- Shared array fetch and flush
--------------------------------------------------------------------------------