Copyright | [2016..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 family IxShapeRepr e where ...
- fromUArray :: forall ix sh e. (HasCallStack, IxShapeRepr (EltR ix) ~ EltR sh, IArray UArray e, Ix ix, Shape sh, Elt ix, Elt e) => UArray ix e -> Array sh e
- toUArray :: forall ix sh e. (HasCallStack, IxShapeRepr (EltR ix) ~ EltR sh, IArray UArray e, Ix ix, Shape sh, Elt e, Elt ix) => Maybe ix -> Array sh e -> UArray ix e
Documentation
type family IxShapeRepr e where ... Source #
IxShapeRepr () = () | |
IxShapeRepr Int = ((), Int) | |
IxShapeRepr (t, h) = (IxShapeRepr t, h) |
fromUArray :: forall ix sh e. (HasCallStack, IxShapeRepr (EltR ix) ~ EltR sh, IArray UArray e, Ix ix, Shape sh, Elt ix, Elt e) => UArray ix e -> Array sh e Source #
O(n). Convert an unboxed UArray
into an Accelerate array.
See fromIArray
for more
information about the array index type.
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
:: (HasCallStack, IxShapeRepr (EltR ix) ~ EltR sh, IArray UArray e, Ix ix, Shape sh, Elt e, Elt ix) | |
=> Maybe ix | if |
-> Array sh e | |
-> UArray ix e |
O(1) (typically). Convert an Accelerate Array
to an unboxed UArray
.
See fromIArray
for more
information about the array index type.
If the array data was allocated by Accelerate, this can typically be done without copying.
since 0.1.0.0