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.IArray

Description

Convert between immutable IArrays and Accelerate Arrays.

Synopsis

Documentation

type family IxShapeRepr e where ... Source #

Equations

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

fromIArray :: (HasCallStack, IxShapeRepr (EltR ix) ~ EltR sh, IArray a e, Ix ix, Shape sh, Elt ix, Elt e) => a ix e -> Array sh e Source #

O(n). Convert an IArray to an Accelerate Array.

The index type ix of the IArray corresponds to the shape sh of the Accelerate Array in the following way:

DIM0 ~ ()
DIM1 ~ Int
DIM2 ~ (Int,Int)
DIM3 ~ (Int,Int,Int)

...and so forth.

toIArray Source #

Arguments

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

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

-> Array sh e 
-> a ix e 

O(n). Convert an Accelerate Array to an IArray.

See fromIArray for a discussion on the expected shape types.