-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | An embedded language for accelerated array processing -- -- This library defines an embedded language for regular, -- multi-dimensional array computations with multiple backends to -- facilitate high-performance implementations. Currently, the only -- backend is an interpreter that serves as a reference implementation of -- the intended semantics of the language. @package accelerate @version 0.5.0.0 -- | Embedded array processing language: execution by a simple interpreter -- -- Copyright (c) [2008..2009] Manuel M T Chakravarty, Gabriele Keller, -- Sean Lee -- -- License: BSD3 module Data.Array.Accelerate.Interpreter run :: (Arrays a) => Acc a -> a -- | An embedded language of accelerated array computations -- -- Copyright (c) [2008..2009] Manuel M T Chakravarty, Gabriele Keller, -- Sean Lee -- -- License: BSD3 module Data.Array.Accelerate -- | 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. data Int :: * -- | 8-bit signed integer type data Int8 :: * -- | 16-bit signed integer type data Int16 :: * -- | 32-bit signed integer type data Int32 :: * -- | 64-bit signed integer type data Int64 :: * -- | A Word is an unsigned integral type, with the same size as -- Int. data Word :: * -- | 8-bit unsigned integer type data Word8 :: * -- | 16-bit unsigned integer type data Word16 :: * -- | 32-bit unsigned integer type data Word32 :: * -- | 64-bit unsigned integer type data Word64 :: * -- | Haskell type representing the C short type. data CShort :: * -- | Haskell type representing the C unsigned short type. data CUShort :: * -- | Haskell type representing the C int type. data CInt :: * -- | Haskell type representing the C unsigned int type. data CUInt :: * -- | Haskell type representing the C long type. data CLong :: * -- | Haskell type representing the C unsigned long type. data CULong :: * -- | Haskell type representing the C long long type. data CLLong :: * -- | Haskell type representing the C unsigned long long type. data CULLong :: * -- | 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 Float :: * -- | 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 Double :: * -- | Haskell type representing the C float type. data CFloat :: * -- | Haskell type representing the C double type. data CDouble :: * data Bool :: * data Char :: * -- | Haskell type representing the C char type. data CChar :: * -- | Haskell type representing the C signed char type. data CSChar :: * -- | Haskell type representing the C unsigned char type. data CUChar :: * -- | Surface arrays --------------- -- -- Multi-dimensional arrays for array processing data Array dim e -- | Scalars type Scalar e = Array DIM0 e -- | Vectors 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 -- | Indices as n-tuples class (Shape ix, Ix (ElemRepr ix)) => Ix ix dim :: (Ix ix) => ix -> Int size :: (Ix ix) => ix -> Int -- | Surface types (tuples of scalars) ---------------------------------- -- -- Identifier for entire dimensions in slice descriptors data All All :: All class (Shape sl, SliceIx (ElemRepr sl), Ix (Slice sl), Ix (CoSlice sl), Ix (SliceDim sl), SliceIxConv sl) => SliceIx sl where { type family Slice sl :: *; type family CoSlice sl :: *; type family SliceDim sl :: *; } sliceIndex :: (SliceIx sl) => sl -> SliceIndex (ElemRepr sl) (Slice (ElemRepr sl)) (CoSlice (ElemRepr sl)) (SliceDim (ElemRepr sl)) -- | Shorthand for common shape types 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 -- | Convert an IArray to an accelerated array. fromIArray :: (IArray a e, Ix dim, Ix dim, Elem e) => a dim e -> Array dim e -- | Convert an accelerated array to an IArray toIArray :: (IArray a e, Ix dim, Ix dim, Elem e) => Array dim e -> a dim e -- | Convert a list (with elements in row-major order) to an accelerated -- array. fromList :: (Ix dim, Elem e) => dim -> [e] -> Array dim e -- | Convert an accelerated array to a list in row-major order. 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 :: (SliceIx slix, Elem e) => Acc (Array (SliceDim slix) e) -> Exp slix -> Acc (Array (Slice slix) e) replicate :: (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