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

Copyright[2012] Adam C. Foltzer
[2012..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.Storable

Description

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

Synopsis

Documentation

type family Vectors 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 (EltRepr e) :: Vector Int
  • if e :: (Double, Float), then Vectors (EltRepr e) :: (((), Vector Double), Vector Float)

Instances

type Vectors Bool Source # 
type Vectors Char Source # 
type Vectors Double Source # 
type Vectors Float Source # 
type Vectors Int Source # 
type Vectors Int8 Source # 
type Vectors Int16 Source # 
type Vectors Int32 Source # 
type Vectors Int64 Source # 
type Vectors Word Source # 
type Vectors Word8 Source # 
type Vectors Word16 Source # 
type Vectors Word32 Source # 
type Vectors Word64 Source # 
type Vectors () Source # 
type Vectors () = ()
type Vectors Half Source # 
type Vectors CDouble Source # 
type Vectors CFloat Source # 
type Vectors CULLong Source # 
type Vectors CLLong Source # 
type Vectors CULong Source # 
type Vectors CULong = Vector HTYPE_UNSIGNED_LONG
type Vectors CLong Source # 
type Vectors CLong = Vector HTYPE_LONG
type Vectors CUInt Source # 
type Vectors CInt Source # 
type Vectors CUShort Source # 
type Vectors CShort Source # 
type Vectors CUChar Source # 
type Vectors CSChar Source # 
type Vectors CChar Source # 
type Vectors CChar = Vector HTYPE_CCHAR
type Vectors (V2 a) Source # 
type Vectors (V2 a) = Vectors a
type Vectors (V3 a) Source # 
type Vectors (V3 a) = Vectors a
type Vectors (V4 a) Source # 
type Vectors (V4 a) = Vectors a
type Vectors (V8 a) Source # 
type Vectors (V8 a) = Vectors a
type Vectors (V16 a) Source # 
type Vectors (V16 a) = Vectors a
type Vectors (a, b) Source # 
type Vectors (a, b) = (Vectors a, Vectors b)

toVectors :: (Shape sh, Elt e) => Array sh e -> Vectors (EltRepr 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 :: (Shape sh, Elt e) => sh -> Vectors (EltRepr 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