- Scalar element types
- Array data types
- Array element types
- Array shapes & indices
- Array operations
- Surface language
- Array and scalar expressions
- Scalar introduction
- Array introduction
- Shape manipulation
- Collective array operations
- Conditional expressions
- Array operations with a scalar result
- Instances of Bounded, Enum, Eq, Ord, Bits, Num, Real, Floating,
- Methods of H98 classes that we need to redefine as their signatures
- Standard functions that we need to redefine as their signatures change
- Conversions
- Constants
An embedded language of accelerated array computations
Copyright (c) [2008..2009] Manuel M T Chakravarty, Gabriele Keller, Sean Lee
License: BSD3
- data Int
- data Int8
- data Int16
- data Int32
- data Int64
- data Word
- data Word8
- data Word16
- data Word32
- data Word64
- data CShort
- data CUShort
- data CInt
- data CUInt
- data CLong
- data CULong
- data CLLong
- data CULLong
- data Float
- data Double
- data CFloat
- data CDouble
- data Bool
- data Char
- data CChar
- data CSChar
- data CUChar
- data Array dim e
- type Scalar e = Array DIM0 e
- type Vector e = Array DIM1 e
- class (Show a, Typeable a, Typeable (ElemRepr a), Typeable (ElemRepr' a), ArrayElem (ElemRepr a), ArrayElem (ElemRepr' a)) => Elem a
- class (Shape ix, Ix (ElemRepr ix)) => Ix ix where
- data All = All
- class (Shape sl, SliceIx (ElemRepr sl), Ix (Slice sl), Ix (CoSlice sl), Ix (SliceDim sl), SliceIxConv sl) => SliceIx sl where
- type Slice sl :: *
- type CoSlice sl :: *
- type SliceDim sl :: *
- sliceIndex :: sl -> SliceIndex (ElemRepr sl) (Slice (ElemRepr sl)) (CoSlice (ElemRepr sl)) (SliceDim (ElemRepr sl))
- type DIM0 = ()
- type DIM1 = Int
- type DIM2 = (Int, Int)
- type DIM3 = (Int, Int, Int)
- type DIM4 = (Int, Int, Int, Int)
- type DIM5 = (Int, Int, Int, Int, Int)
- arrayShape :: Ix dim => Array dim e -> dim
- indexArray :: Array dim e -> dim -> e
- fromIArray :: (IArray a e, Ix dim, Ix dim, Elem e) => a dim e -> Array dim e
- toIArray :: (IArray a e, Ix dim, Ix dim, Elem e) => Array dim e -> a dim e
- fromList :: (Ix dim, Elem e) => dim -> [e] -> Array dim e
- toList :: Array dim e -> [e]
- class Delayable (ArraysRepr as) => Arrays as
- data Acc a
- data Exp t
- constant :: Elem t => t -> Exp t
- use :: (Ix dim, Elem e) => Array dim e -> Acc (Array dim e)
- unit :: Elem e => Exp e -> Acc (Scalar e)
- reshape :: (Ix dim, Ix dim', Elem e) => Exp dim -> Acc (Array dim' e) -> Acc (Array dim e)
- slice :: forall slix e. (SliceIx slix, Elem e) => Acc (Array (SliceDim slix) e) -> Exp slix -> Acc (Array (Slice slix) e)
- replicate :: forall slix e. (SliceIx slix, Elem e) => Exp slix -> Acc (Array (Slice slix) e) -> Acc (Array (SliceDim slix) e)
- zip :: (Ix dim, Elem a, Elem b) => Acc (Array dim a) -> Acc (Array dim b) -> Acc (Array dim (a, b))
- map :: (Ix dim, Elem a, Elem b) => (Exp a -> Exp b) -> Acc (Array dim a) -> Acc (Array dim b)
- zipWith :: (Ix dim, Elem a, Elem b, Elem c) => (Exp a -> Exp b -> Exp c) -> Acc (Array dim a) -> Acc (Array dim b) -> Acc (Array dim c)
- scan :: Elem a => (Exp a -> Exp a -> Exp a) -> Exp a -> Acc (Vector a) -> (Acc (Vector a), Acc (Scalar a))
- fold :: Elem a => (Exp a -> Exp a -> Exp a) -> Exp a -> Acc (Vector a) -> Acc (Scalar a)
- permute :: (Ix dim, Ix dim', Elem a) => (Exp a -> Exp a -> Exp a) -> Acc (Array dim' a) -> (Exp dim -> Exp dim') -> Acc (Array dim a) -> Acc (Array dim' a)
- backpermute :: (Ix dim, Ix dim', Elem a) => Exp dim' -> (Exp dim' -> Exp dim) -> Acc (Array dim a) -> Acc (Array dim' a)
- (?) :: Elem t => Exp Bool -> (Exp t, Exp t) -> Exp t
- (!) :: (Ix dim, Elem e) => Acc (Array dim e) -> Exp dim -> Exp e
- shape :: Ix dim => Acc (Array dim e) -> Exp dim
- (==*) :: (Elem t, IsScalar t) => Exp t -> Exp t -> Exp Bool
- (/=*) :: (Elem t, IsScalar t) => Exp t -> Exp t -> Exp Bool
- (<*) :: (Elem t, IsScalar t) => Exp t -> Exp t -> Exp Bool
- (<=*) :: (Elem t, IsScalar t) => Exp t -> Exp t -> Exp Bool
- (>*) :: (Elem t, IsScalar t) => Exp t -> Exp t -> Exp Bool
- (>=*) :: (Elem t, IsScalar t) => Exp t -> Exp t -> Exp Bool
- max :: (Elem t, IsScalar t) => Exp t -> Exp t -> Exp t
- min :: (Elem t, IsScalar t) => Exp t -> Exp t -> Exp t
- (&&*) :: Exp Bool -> Exp Bool -> Exp Bool
- (||*) :: Exp Bool -> Exp Bool -> Exp Bool
- not :: Exp Bool -> Exp Bool
- boolToInt :: Exp Bool -> Exp Int
- ignore :: Ix dim => Exp dim
Scalar element types
data Int
A fixed-precision integer type with at least the range [-2^29 .. 2^29-1]
.
The exact range for a given implementation can be determined by using
Prelude.minBound and Prelude.maxBound from the Prelude.Bounded class.
Bounded Int | |
Enum Int | |
Eq Int | |
Integral Int | |
Num Int | |
Ord Int | |
Real Int | |
Show Int | |
Ix Int | |
Typeable Int | |
Bits Int | |
IsScalar Int | |
IsBounded Int | |
IsNum Int | |
IsIntegral Int | |
ArrayElem Int | |
Ix Int | |
Shape Int | |
ShapeBase Int | |
Elem Int | |
IArray UArray Int | |
MArray (STUArray s) Int (ST s) | |
SliceIx sl => SliceIx (sl, Int) | |
Ix ix => Ix (ix, Int) | |
Ix (Int, Int) | |
Ix (Int, Int, Int) | |
Ix (Int, Int, Int, Int) | |
Ix (Int, Int, Int, Int, Int) |
data Int8
8-bit signed integer type
data Int16
16-bit signed integer type
data Int32
32-bit signed integer type
data Int64
64-bit signed integer type
data Word
data Word8
8-bit unsigned integer type
data Word16
16-bit unsigned integer type
data Word32
32-bit unsigned integer type
data Word64
64-bit unsigned integer type
data CShort
Haskell type representing the C short
type.
data CUShort
Haskell type representing the C unsigned short
type.
data CInt
Haskell type representing the C int
type.
data CUInt
Haskell type representing the C unsigned int
type.
data CLong
Haskell type representing the C long
type.
data CULong
Haskell type representing the C unsigned long
type.
data CLLong
Haskell type representing the C long long
type.
data CULLong
Haskell type representing the C unsigned long long
type.
data Float
Single-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE single-precision type.
data Double
Double-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE double-precision type.
data CFloat
Haskell type representing the C float
type.
data CDouble
Haskell type representing the C double
type.
data Bool
data Char
data CChar
Haskell type representing the C char
type.
data CSChar
Haskell type representing the C signed char
type.
data CUChar
Haskell type representing the C unsigned char
type.
Array data types
Surface arrays ---------------
Multi-dimensional arrays for array processing
Array element types
class (Show a, Typeable a, Typeable (ElemRepr a), Typeable (ElemRepr' a), ArrayElem (ElemRepr a), ArrayElem (ElemRepr' a)) => Elem a Source
Elem Bool | |
Elem Char | |
Elem Double | |
Elem Float | |
Elem Int | |
Elem Int8 | |
Elem Int16 | |
Elem Int32 | |
Elem Int64 | |
Elem Word | |
Elem Word8 | |
Elem Word16 | |
Elem Word32 | |
Elem Word64 | |
Elem () | |
Elem All | |
(Elem a, Elem b) => Elem (a, b) | |
(Elem a, Elem b, Elem c) => Elem (a, b, c) | |
(Elem a, Elem b, Elem c, Elem d) => Elem (a, b, c, d) | |
(Elem a, Elem b, Elem c, Elem d, Elem e) => Elem (a, b, c, d, e) |
Array shapes & indices
Surface types (tuples of scalars) ----------------------------------
Identifier for entire dimensions in slice descriptors
class (Shape sl, SliceIx (ElemRepr sl), Ix (Slice sl), Ix (CoSlice sl), Ix (SliceDim sl), SliceIxConv sl) => SliceIx sl whereSource
sliceIndex :: sl -> SliceIndex (ElemRepr sl) (Slice (ElemRepr sl)) (CoSlice (ElemRepr sl)) (SliceDim (ElemRepr sl))Source
Array operations
arrayShape :: Ix dim => Array dim e -> dimSource
indexArray :: Array dim e -> dim -> eSource
fromIArray :: (IArray a e, Ix dim, Ix dim, Elem e) => a dim e -> Array dim eSource
Convert an IArray
to an accelerated array.
toIArray :: (IArray a e, Ix dim, Ix dim, Elem e) => Array dim e -> a dim eSource
Convert an accelerated array to an IArray
fromList :: (Ix dim, Elem e) => dim -> [e] -> Array dim eSource
Convert a list (with elements in row-major order) to an accelerated array.
Surface language
Array and scalar expressions
(Elem t, IsBounded t) => Bounded (Exp t) | |
(Elem t, IsScalar t) => Enum (Exp t) | |
(Elem t, IsScalar t) => Eq (Exp t) | |
(Elem t, IsFloating t) => Floating (Exp t) | |
(Elem t, IsFloating t) => Fractional (Exp t) | |
(Elem t, IsIntegral t) => Integral (Exp t) | |
(Elem t, IsNum t) => Num (Exp t) | |
(Elem t, IsScalar t) => Ord (Exp t) | |
(Elem t, IsNum t) => Real (Exp t) | |
(Elem t, IsFloating t) => RealFloat (Exp t) | |
(Elem t, IsFloating t) => RealFrac (Exp t) | |
Show (Exp t) | |
(Elem t, IsNum t, IsIntegral t) => Bits (Exp t) |
Scalar introduction
Array introduction
Shape manipulation
Collective array operations
slice :: forall slix e. (SliceIx slix, Elem e) => Acc (Array (SliceDim slix) e) -> Exp slix -> Acc (Array (Slice slix) e)Source
replicate :: forall slix e. (SliceIx slix, Elem e) => Exp slix -> Acc (Array (Slice slix) e) -> Acc (Array (SliceDim slix) e)Source
zip :: (Ix dim, Elem a, Elem b) => Acc (Array dim a) -> Acc (Array dim b) -> Acc (Array dim (a, b))Source
zipWith :: (Ix dim, Elem a, Elem b, Elem c) => (Exp a -> Exp b -> Exp c) -> Acc (Array dim a) -> Acc (Array dim b) -> Acc (Array dim c)Source
scan :: Elem a => (Exp a -> Exp a -> Exp a) -> Exp a -> Acc (Vector a) -> (Acc (Vector a), Acc (Scalar a))Source
permute :: (Ix dim, Ix dim', Elem a) => (Exp a -> Exp a -> Exp a) -> Acc (Array dim' a) -> (Exp dim -> Exp dim') -> Acc (Array dim a) -> Acc (Array dim' a)Source
backpermute :: (Ix dim, Ix dim', Elem a) => Exp dim' -> (Exp dim' -> Exp dim) -> Acc (Array dim a) -> Acc (Array dim' a)Source