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

Copyright[2017..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.Vector.Primitive

Description

Efficient conversion between Primitive vectors and Accelerate Arrays.

Synopsis

Documentation

type Vectors e = GArrayDataR Vector 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 :: forall sh e. (HasCallStack, Shape sh, Elt e) => Array sh e -> Vectors (EltR 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 0.1.0.0

fromVectors :: forall sh e. (HasCallStack, Shape sh, Elt e) => sh -> Vectors (EltR 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 0.1.0.0