accelerate-io-array-0.1.0.0: Convert between Accelerate and array

Copyright[2016..2020] The Accelerate Team
LicenseBSD3
MaintainerTrevor L. McDonell <trevor.mcdonell@gmail.com>
Stabilityexperimental
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Data.Array.Accelerate.IO.Data.Array.Unboxed

Description

Efficient conversion between immutable unboxed IArrays and Accelerate Arrays.

Synopsis

Documentation

type family IxShapeRepr e where ... Source #

Equations

IxShapeRepr () = () 
IxShapeRepr Int = ((), Int) 
IxShapeRepr (t, h) = (IxShapeRepr t, h) 

fromUArray :: forall ix sh e. (HasCallStack, IxShapeRepr (EltR ix) ~ EltR sh, IArray UArray e, Ix ix, Shape sh, Elt ix, Elt e) => UArray ix e -> Array sh e Source #

O(n). Convert an unboxed UArray into an Accelerate array.

See fromIArray for more information about the array index type.

If the underlying vectors are pinned then this can be done without copying.

See also: https://ghc.haskell.org/trac/ghc/ticket/5556

since 0.1.0.0

toUArray Source #

Arguments

:: (HasCallStack, IxShapeRepr (EltR ix) ~ EltR sh, IArray UArray e, Ix ix, Shape sh, Elt e, Elt ix) 
=> Maybe ix

if Just this is the index lower bound, otherwise the array is indexed from zero

-> Array sh e 
-> UArray ix e 

O(1) (typically). Convert an Accelerate Array to an unboxed UArray.

See fromIArray for more information about the array index type.

If the array data was allocated by Accelerate, this can typically be done without copying.

since 0.1.0.0