Copyright | [2017..2020] The Accelerate Team |
---|---|

License | BSD3 |

Maintainer | Trevor L. McDonell <trevor.mcdonell@gmail.com> |

Stability | experimental |

Portability | non-portable (GHC extensions) |

Safe Haskell | None |

Language | Haskell2010 |

## Synopsis

- type Vectors e = GArrayDataR Vector e
- toVectors :: forall sh e. (HasCallStack, Shape sh, Elt e) => Array sh e -> Vectors (EltR e)
- fromVectors :: forall sh e. (HasCallStack, Shape sh, Elt e) => sh -> Vectors (EltR e) -> Array sh e

# 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