accelerate-io-repa-0.1.0.0: Convert between Accelerate and Repa arrays

Copyright[2012..2014] Trevor L. McDonell
LicenseBSD3
MaintainerTrevor L. McDonell <trevor.mcdonell@gmail.com>
Stabilityexperimental
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Data.Array.Repa.Repr.Accelerate

Description

This provides an efficient non-copying Repa manifest array representation that can be passed directly to Accelerate.

The standard rules for dealing with manifest Repa arrays apply:

  • If you want to have Repa computeP directly into an Accelerate array, the source array must have a delayed representation.
  • If you want to copy between manifest arrays, use copyP instead.
Synopsis

Documentation

data A Source #

The representation tag for manifest arrays based on Data.Array.Accelerate.

The Accelerate array implementation is based on type families and picks an efficient, unboxed representation for every element type. Moreover, these arrays can be handed efficiently (without copying) to Accelerate programs for further computation.

Instances
Elt e => Target A e Source #

Filling Accelerate arrays

Instance details

Defined in Data.Array.Repa.Repr.Accelerate

Associated Types

data MVec A e :: Type #

Methods

newMVec :: Int -> IO (MVec A e) #

unsafeWriteMVec :: MVec A e -> Int -> e -> IO () #

unsafeFreezeMVec :: sh -> MVec A e -> IO (Array A sh e) #

deepSeqMVec :: MVec A e -> a -> a #

touchMVec :: MVec A e -> IO () #

Elt e => Source A e Source #

Reading elements of the Accelerate array

Instance details

Defined in Data.Array.Repa.Repr.Accelerate

Associated Types

data Array A sh e :: Type #

Methods

extent :: Shape sh => Array A sh e -> sh #

index :: Shape sh => Array A sh e -> sh -> e #

unsafeIndex :: Shape sh => Array A sh e -> sh -> e #

linearIndex :: Shape sh => Array A sh e -> Int -> e #

unsafeLinearIndex :: Shape sh => Array A sh e -> Int -> e #

deepSeqArray :: Shape sh => Array A sh e -> b -> b #

data MVec A e Source # 
Instance details

Defined in Data.Array.Repa.Repr.Accelerate

data MVec A e = MAVec (MutableArrayData (EltR e))
data Array A sh e Source # 
Instance details

Defined in Data.Array.Repa.Repr.Accelerate

data Array A sh e = AAccelerate !sh !(ArrayData (EltR e))

class (Shape r, Shape a) => Shapes r a | a -> r, r -> a Source #

Index conversion and equivalence statement between Repa and Accelerate array shapes. That is, a n-dimensional Repa array will produce an n-dimensional Accelerate array of the same extent, and vice-versa.

Minimal complete definition

toR, toA

Instances
Shapes Z Z Source # 
Instance details

Defined in Data.Array.Repa.Repr.Accelerate

Methods

toR :: Z0 -> Z

toA :: Z -> Z0

Shapes sr sa => Shapes (sr :. Int) (sa :. Int) Source # 
Instance details

Defined in Data.Array.Repa.Repr.Accelerate

Methods

toR :: (sa :. Int) -> sr :. Int

toA :: (sr :. Int) -> sa :. Int

fromRepa :: (Shapes sh sh', Elt e) => Array A sh e -> Array sh' e Source #

O(1). Unpack to an Accelerate array.

toRepa :: Shapes sh sh' => Array sh' e -> Array A sh e Source #

O(1). Wrap an Accelerate array.

computeAccS :: (Load r sh e, Elt e) => Array r sh e -> Array A sh e Source #

Sequential computation of array elements

computeAccP :: (Load r sh e, Elt e, Monad m) => Array r sh e -> m (Array A sh e) Source #

Parallel computation of array elements