-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Convert between Accelerate and array -- -- This package provides efficient conversion routines between Accelerate -- arrays and those from the array library. -- -- Refer to the main Accelerate package for more information: -- http://hackage.haskell.org/package/accelerate @package accelerate-io-array @version 0.1.0.0 -- | Convert between immutable IArrays and Accelerate Arrays. module Data.Array.Accelerate.IO.Data.Array.IArray type family IxShapeRepr e -- | O(n). Convert an IArray to an Accelerate Array. -- -- The index type ix of the IArray corresponds to the -- shape sh of the Accelerate Array in the following way: -- --
-- DIM0 ~ () -- DIM1 ~ Int -- DIM2 ~ (Int,Int) -- DIM3 ~ (Int,Int,Int) ---- -- ...and so forth. fromIArray :: (HasCallStack, IxShapeRepr (EltR ix) ~ EltR sh, IArray a e, Ix ix, Shape sh, Elt ix, Elt e) => a ix e -> Array sh e -- | O(n). Convert an Accelerate Array to an IArray. -- -- See fromIArray for a discussion on the expected shape types. toIArray :: forall ix sh a e. (HasCallStack, IxShapeRepr (EltR ix) ~ EltR sh, IArray a e, Ix ix, Shape sh, Elt e, Elt ix) => Maybe ix -> Array sh e -> a ix e -- | Efficient conversion between immutable unboxed IArrays and -- Accelerate Arrays. module Data.Array.Accelerate.IO.Data.Array.Unboxed type family IxShapeRepr e -- | 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 --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 -- | 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 --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