accelerate-io-1.2.0.0: Read and write Accelerate arrays in various formats

Copyright[2017] Trevor L. McDonell
LicenseBSD3
MaintainerTrevor L. McDonell <tmcdonell@cse.unsw.edu.au>
Stabilityexperimental
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Data.Array.Accelerate.IO.Data.Vector.Primitive

Description

Efficient conversion between Primitive vectors and Accelerate Arrays.

Synopsis

Documentation

type family Vectors e :: * Source #

A family of types which represent a collection of Primitive Vectors. The structure of the collection depends on the element type e of the corresponding Accelerate array.

toVectors :: (Shape sh, Elt e) => Array sh e -> Vectors (EltRepr e) Source #

O(1) (typically). Convert an Accelerate array into a collection of primitive vectors.

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

since 1.1.0.0

fromVectors :: (Shape sh, Elt e) => sh -> Vectors (EltRepr e) -> Array sh e Source #

O(n) (typically). Convert a collection of primitive vectors into an Accelerate array.

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

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

since 1.1.0.0