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

Description

Efficient conversion between Unboxed vectors and Accelerate Arrays.

Synopsis

Documentation

class (Unbox e, Elt e) => Unbox e where Source #

Methods

arrayDataOfUnboxed :: Vector e -> ArrayData (EltR e) Source #

unboxedOfArrayData :: Int -> ArrayData (EltR e) -> Vector e Source #

Instances
Unbox Double Source # 
Instance details

Defined in Data.Array.Accelerate.IO.Data.Vector.Unboxed

Methods

arrayDataOfUnboxed :: Vector Double -> ArrayData (EltR Double) Source #

unboxedOfArrayData :: Int -> ArrayData (EltR Double) -> Vector Double Source #

Unbox Float Source # 
Instance details

Defined in Data.Array.Accelerate.IO.Data.Vector.Unboxed

Methods

arrayDataOfUnboxed :: Vector Float -> ArrayData (EltR Float) Source #

unboxedOfArrayData :: Int -> ArrayData (EltR Float) -> Vector Float Source #

Unbox Int Source # 
Instance details

Defined in Data.Array.Accelerate.IO.Data.Vector.Unboxed

Methods

arrayDataOfUnboxed :: Vector Int -> ArrayData (EltR Int) Source #

unboxedOfArrayData :: Int -> ArrayData (EltR Int) -> Vector Int Source #

Unbox Int8 Source # 
Instance details

Defined in Data.Array.Accelerate.IO.Data.Vector.Unboxed

Methods

arrayDataOfUnboxed :: Vector Int8 -> ArrayData (EltR Int8) Source #

unboxedOfArrayData :: Int -> ArrayData (EltR Int8) -> Vector Int8 Source #

Unbox Int16 Source # 
Instance details

Defined in Data.Array.Accelerate.IO.Data.Vector.Unboxed

Methods

arrayDataOfUnboxed :: Vector Int16 -> ArrayData (EltR Int16) Source #

unboxedOfArrayData :: Int -> ArrayData (EltR Int16) -> Vector Int16 Source #

Unbox Int32 Source # 
Instance details

Defined in Data.Array.Accelerate.IO.Data.Vector.Unboxed

Methods

arrayDataOfUnboxed :: Vector Int32 -> ArrayData (EltR Int32) Source #

unboxedOfArrayData :: Int -> ArrayData (EltR Int32) -> Vector Int32 Source #

Unbox Int64 Source # 
Instance details

Defined in Data.Array.Accelerate.IO.Data.Vector.Unboxed

Methods

arrayDataOfUnboxed :: Vector Int64 -> ArrayData (EltR Int64) Source #

unboxedOfArrayData :: Int -> ArrayData (EltR Int64) -> Vector Int64 Source #

Unbox Word Source # 
Instance details

Defined in Data.Array.Accelerate.IO.Data.Vector.Unboxed

Methods

arrayDataOfUnboxed :: Vector Word -> ArrayData (EltR Word) Source #

unboxedOfArrayData :: Int -> ArrayData (EltR Word) -> Vector Word Source #

Unbox Word8 Source # 
Instance details

Defined in Data.Array.Accelerate.IO.Data.Vector.Unboxed

Methods

arrayDataOfUnboxed :: Vector Word8 -> ArrayData (EltR Word8) Source #

unboxedOfArrayData :: Int -> ArrayData (EltR Word8) -> Vector Word8 Source #

Unbox Word16 Source # 
Instance details

Defined in Data.Array.Accelerate.IO.Data.Vector.Unboxed

Methods

arrayDataOfUnboxed :: Vector Word16 -> ArrayData (EltR Word16) Source #

unboxedOfArrayData :: Int -> ArrayData (EltR Word16) -> Vector Word16 Source #

Unbox Word32 Source # 
Instance details

Defined in Data.Array.Accelerate.IO.Data.Vector.Unboxed

Methods

arrayDataOfUnboxed :: Vector Word32 -> ArrayData (EltR Word32) Source #

unboxedOfArrayData :: Int -> ArrayData (EltR Word32) -> Vector Word32 Source #

Unbox Word64 Source # 
Instance details

Defined in Data.Array.Accelerate.IO.Data.Vector.Unboxed

Methods

arrayDataOfUnboxed :: Vector Word64 -> ArrayData (EltR Word64) Source #

unboxedOfArrayData :: Int -> ArrayData (EltR Word64) -> Vector Word64 Source #

Unbox () Source # 
Instance details

Defined in Data.Array.Accelerate.IO.Data.Vector.Unboxed

Methods

arrayDataOfUnboxed :: Vector () -> ArrayData (EltR ()) Source #

unboxedOfArrayData :: Int -> ArrayData (EltR ()) -> Vector () Source #

(Unbox a, Unbox b) => Unbox (a, b) Source # 
Instance details

Defined in Data.Array.Accelerate.IO.Data.Vector.Unboxed

Methods

arrayDataOfUnboxed :: Vector (a, b) -> ArrayData (EltR (a, b)) Source #

unboxedOfArrayData :: Int -> ArrayData (EltR (a, b)) -> Vector (a, b) Source #

(Unbox a, Unbox b, Unbox c) => Unbox (a, b, c) Source # 
Instance details

Defined in Data.Array.Accelerate.IO.Data.Vector.Unboxed

Methods

arrayDataOfUnboxed :: Vector (a, b, c) -> ArrayData (EltR (a, b, c)) Source #

unboxedOfArrayData :: Int -> ArrayData (EltR (a, b, c)) -> Vector (a, b, c) Source #

(Unbox a, Unbox b, Unbox c, Unbox d) => Unbox (a, b, c, d) Source # 
Instance details

Defined in Data.Array.Accelerate.IO.Data.Vector.Unboxed

Methods

arrayDataOfUnboxed :: Vector (a, b, c, d) -> ArrayData (EltR (a, b, c, d)) Source #

unboxedOfArrayData :: Int -> ArrayData (EltR (a, b, c, d)) -> Vector (a, b, c, d) Source #

(Unbox a, Unbox b, Unbox c, Unbox d, Unbox e) => Unbox (a, b, c, d, e) Source # 
Instance details

Defined in Data.Array.Accelerate.IO.Data.Vector.Unboxed

Methods

arrayDataOfUnboxed :: Vector (a, b, c, d, e) -> ArrayData (EltR (a, b, c, d, e)) Source #

unboxedOfArrayData :: Int -> ArrayData (EltR (a, b, c, d, e)) -> Vector (a, b, c, d, e) Source #

(Unbox a, Unbox b, Unbox c, Unbox d, Unbox e, Unbox f) => Unbox (a, b, c, d, e, f) Source # 
Instance details

Defined in Data.Array.Accelerate.IO.Data.Vector.Unboxed

Methods

arrayDataOfUnboxed :: Vector (a, b, c, d, e, f) -> ArrayData (EltR (a, b, c, d, e, f)) Source #

unboxedOfArrayData :: Int -> ArrayData (EltR (a, b, c, d, e, f)) -> Vector (a, b, c, d, e, f) Source #

toUnboxed :: forall sh e. (Shape sh, Unbox e) => Array sh e -> Vector e Source #

O(1) (typically). Convert an Accelerate array into an Unboxed vector.

If the array data was allocated by Accelerate, this can typically be done without copying. The resulting vector will be pinned.

since 0.1.0.0

fromUnboxed :: Unbox e => Vector e -> Array DIM1 e Source #

O(n) (typically). Convert an Unboxed vector into an Accelerate array.

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

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

since 0.1.0.0