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

Copyright[2012..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.Storable

Description

Efficient non-copying conversion between Storable vectors and Accelerate Arrays.

Synopsis

Documentation

type Vectors e = GArrayDataR Vector e Source #

A family of types that represents a collection of storable Vectors. The structure of the collection depends on the element type e.

For example:

  • if e :: Int, then Vectors (EltR e) :: Vector Int
  • if e :: (Double, Float), then Vectors (EltR e) :: (((), Vector Double), Vector Float)

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

O(1). Turn the Accelerate array into a collection of storable Vectors. The element type of the array e will determine the structure of the output collection. See Vectors.

Data will be output in row-major order.

fromVectors :: forall sh e. (HasCallStack, Shape sh, Elt e) => sh -> Vectors (EltR e) -> Array sh e Source #

O(1). Treat a set of storable vectors as Accelerate arrays. The type of elements e in the output Accelerate array determines the structure of the collection that will be required as the second argument. See Vectors.

Data will be consumed from the vector in row-major order. You must make sure that each of the input vectors contains the right number of elements