accelerate-0.9.0.1: An embedded language for accelerated array processing

Portabilitynon-portable (GHC extensions)
Stabilityexperimental
MaintainerManuel M T Chakravarty <chak@cse.unsw.edu.au>
Safe HaskellNone

Data.Array.Accelerate.Array.Representation

Contents

Description

 

Synopsis

Array shapes, indices, and slices

class (Eq sh, Slice sh) => Shape sh whereSource

Index representation

Class of index representations (which are nested pairs)

Methods

dimSource

Arguments

:: sh 
-> Int

number of dimensions (>= 0); rank of the array

sizeSource

Arguments

:: sh 
-> Int

total number of elements in an array of this shape

intersect :: sh -> sh -> shSource

ignore :: shSource

index :: sh -> sh -> IntSource

bound :: sh -> sh -> Boundary e -> Either e shSource

iter :: sh -> (sh -> a) -> (a -> a -> a) -> a -> aSource

iter1 :: sh -> (sh -> a) -> (a -> a -> a) -> aSource

rangeToShape :: (sh, sh) -> shSource

shapeToRange :: sh -> (sh, sh)Source

shapeToList :: sh -> [Int]Source

listToShape :: [Int] -> shSource

Instances

Shape () 
Shape sh => Shape (sh, Int) 

class Slice sl whereSource

Slice representation

Class of slice representations (which are nested pairs)

Associated Types

type SliceShape sl Source

type CoSliceShape sl Source

type FullShape sl Source

Methods

sliceIndex :: sl -> SliceIndex sl (SliceShape sl) (CoSliceShape sl) (FullShape sl)Source

Instances

Slice () 
Slice sl => Slice (sl, Int) 
Slice sl => Slice (sl, ()) 

data SliceIndex ix slice coSlice sliceDim whereSource

Generalised array index, which may index only in a subset of the dimensions of a shape.

Constructors

SliceNil :: SliceIndex () () () () 
SliceAll :: SliceIndex ix slice co dim -> SliceIndex (ix, ()) (slice, Int) co (dim, Int) 
SliceFixed :: SliceIndex ix slice co dim -> SliceIndex (ix, Int) slice (co, Int) (dim, Int) 

Instances

Show (SliceIndex ix slice coSlice sliceDim)