accelerate-1.1.0.0: An embedded language for accelerated array processing

Copyright[2008..2017] Manuel M T Chakravarty Gabriele Keller
[2009..2017] Trevor L. McDonell
[2014..2014] Frederik M. Madsen
LicenseBSD3
MaintainerTrevor L. McDonell <tmcdonell@cse.unsw.edu.au>
Stabilityexperimental
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell98

Data.Array.Accelerate.Interpreter

Contents

Description

This interpreter is meant to be a reference implementation of the semantics of the embedded array language. The emphasis is on defining the semantics clearly, not on performance.

Synopsis

Interpret an array expression

data Acc a Source #

Accelerate is an embedded language that distinguishes between vanilla arrays (e.g. in Haskell memory on the CPU) and embedded arrays (e.g. in device memory on a GPU), as well as the computations on both of these. Since Accelerate is an embedded language, programs written in Accelerate are not compiled by the Haskell compiler (GHC). Rather, each Accelerate backend is a runtime compiler which generates and executes parallel SIMD code of the target language at application runtime.

The type constructor Acc represents embedded collective array operations. A term of type Acc a is an Accelerate program which, once executed, will produce a value of type a (an Array or a tuple of Arrays). Collective operations of type Acc a comprise many scalar expressions, wrapped in type constructor Exp, which will be executed in parallel. Although collective operations comprise many scalar operations executed in parallel, scalar operations cannot initiate new collective operations: this stratification between scalar operations in Exp and array operations in Acc helps statically exclude nested data parallelism, which is difficult to execute efficiently on constrained hardware such as GPUs.

For example, to compute a vector dot product we could write:

dotp :: Num a => Vector a -> Vector a -> Acc (Scalar a)
dotp xs ys =
  let
      xs' = use xs
      ys' = use ys
  in
  fold (+) 0 ( zipWith (*) xs' ys' )

The function dotp consumes two one-dimensional arrays (Vectors) of values, and produces a single (Scalar) result as output. As the return type is wrapped in the type Acc, we see that it is an embedded Accelerate computation - it will be evaluated in the object language of dynamically generated parallel code, rather than the meta language of vanilla Haskell.

As the arguments to dotp are plain Haskell arrays, to make these available to Accelerate computations they must be embedded with the use function.

An Accelerate backend is used to evaluate the embedded computation and return the result back to vanilla Haskell. Calling the run function of a backend will generate code for the target architecture, compile, and execute it. For example, the following backends are available:

See also Exp, which encapsulates embedded scalar computations.

Fusion:

Array computations of type Acc will be subject to array fusion; Accelerate will combine individual Acc computations into a single computation, which reduces the number of traversals over the input data and thus improves performance. As such, it is often useful to have some intuition on when fusion should occur.

The main idea is to first partition array operations into two categories:

  1. Element-wise operations, such as map, generate, and backpermute. Each element of these operations can be computed independently of all others.
  2. Collective operations such as fold, scanl, and stencil. To compute each output element of these operations requires reading multiple elements from the input array(s).

Element-wise operations fuse together whenever the consumer operation uses a single element of the input array. Element-wise operations can both fuse their inputs into themselves, as well be fused into later operations. Both these examples should fuse into a single loop:

map -> reverse -> reshape -> map -> map
map -> backpermute ->
                      zipWith -> map
          generate ->

If the consumer operation uses more than one element of the input array (typically, via generate indexing an array multiple times), then the input array will be completely evaluated first; no fusion occurs in this case, because fusing the first operation into the second implies duplicating work.

On the other hand, collective operations can fuse their input arrays into themselves, but on output always evaluate to an array; collective operations will not be fused into a later step. For example:

     use ->
            zipWith -> fold |-> map
generate ->

Here the element-wise sequence (use + generate + zipWith) will fuse into a single operation, which then fuses into the collective fold operation. At this point in the program the fold must now be evaluated. In the final step the map reads in the array produced by fold. As there is no fusion between the fold and map steps, this program consists of two "loops"; one for the use + generate + zipWith + fold step, and one for the final map step.

You can see how many operations will be executed in the fused program by Show-ing the Acc program, or by using the debugging option -ddump-dot to save the program as a graphviz DOT file.

As a special note, the operations unzip and reshape, when applied to a real array, are executed in constant time, so in this situation these operations will not be fused.

Tips:
  • Since Acc represents embedded computations that will only be executed when evaluated by a backend, we can programatically generate these computations using the meta language Haskell; for example, unrolling loops or embedding input values into the generated code.
  • It is usually best to keep all intermediate computations in Acc, and only run the computation at the very end to produce the final result. This enables optimisations between intermediate results (e.g. array fusion) and, if the target architecture has a separate memory space as is the case of GPUs, to prevent excessive data transfers.

Instances

IfThenElse Acc Source # 

Associated Types

type EltT (Acc :: * -> *) a :: Constraint Source #

Methods

ifThenElse :: EltT Acc a => Exp Bool -> Acc a -> Acc a -> Acc a Source #

Unlift Acc (Acc a) Source # 

Methods

unlift :: Acc (Plain (Acc a)) -> Acc a Source #

Lift Acc (Acc a) Source # 

Associated Types

type Plain (Acc a) :: * Source #

Methods

lift :: Acc a -> Acc (Plain (Acc a)) Source #

(Arrays a, Arrays b) => Unlift Acc (Acc a, Acc b) Source # 

Methods

unlift :: Acc (Plain (Acc a, Acc b)) -> (Acc a, Acc b) Source #

(Lift Acc a, Lift Acc b, Arrays (Plain a), Arrays (Plain b)) => Lift Acc (a, b) Source # 

Associated Types

type Plain (a, b) :: * Source #

Methods

lift :: (a, b) -> Acc (Plain (a, b)) Source #

(Shape sh, Elt e) => Lift Acc (Array sh e) Source # 

Associated Types

type Plain (Array sh e) :: * Source #

Methods

lift :: Array sh e -> Acc (Plain (Array sh e)) Source #

(Arrays a, Arrays b, Arrays c) => Unlift Acc (Acc a, Acc b, Acc c) Source # 

Methods

unlift :: Acc (Plain (Acc a, Acc b, Acc c)) -> (Acc a, Acc b, Acc c) Source #

(Lift Acc a, Lift Acc b, Lift Acc c, Arrays (Plain a), Arrays (Plain b), Arrays (Plain c)) => Lift Acc (a, b, c) Source # 

Associated Types

type Plain (a, b, c) :: * Source #

Methods

lift :: (a, b, c) -> Acc (Plain (a, b, c)) Source #

(Arrays a, Arrays b, Arrays c, Arrays d) => Unlift Acc (Acc a, Acc b, Acc c, Acc d) Source # 

Methods

unlift :: Acc (Plain (Acc a, Acc b, Acc c, Acc d)) -> (Acc a, Acc b, Acc c, Acc d) Source #

(Lift Acc a, Lift Acc b, Lift Acc c, Lift Acc d, Arrays (Plain a), Arrays (Plain b), Arrays (Plain c), Arrays (Plain d)) => Lift Acc (a, b, c, d) Source # 

Associated Types

type Plain (a, b, c, d) :: * Source #

Methods

lift :: (a, b, c, d) -> Acc (Plain (a, b, c, d)) Source #

(Arrays a, Arrays b, Arrays c, Arrays d, Arrays e) => Unlift Acc (Acc a, Acc b, Acc c, Acc d, Acc e) Source # 

Methods

unlift :: Acc (Plain (Acc a, Acc b, Acc c, Acc d, Acc e)) -> (Acc a, Acc b, Acc c, Acc d, Acc e) Source #

(Lift Acc a, Lift Acc b, Lift Acc c, Lift Acc d, Lift Acc e, Arrays (Plain a), Arrays (Plain b), Arrays (Plain c), Arrays (Plain d), Arrays (Plain e)) => Lift Acc (a, b, c, d, e) Source # 

Associated Types

type Plain (a, b, c, d, e) :: * Source #

Methods

lift :: (a, b, c, d, e) -> Acc (Plain (a, b, c, d, e)) Source #

(Arrays a, Arrays b, Arrays c, Arrays d, Arrays e, Arrays f) => Unlift Acc (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f) Source # 

Methods

unlift :: Acc (Plain (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f)) -> (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f) Source #

(Lift Acc a, Lift Acc b, Lift Acc c, Lift Acc d, Lift Acc e, Lift Acc f, Arrays (Plain a), Arrays (Plain b), Arrays (Plain c), Arrays (Plain d), Arrays (Plain e), Arrays (Plain f)) => Lift Acc (a, b, c, d, e, f) Source # 

Associated Types

type Plain (a, b, c, d, e, f) :: * Source #

Methods

lift :: (a, b, c, d, e, f) -> Acc (Plain (a, b, c, d, e, f)) Source #

(Arrays a, Arrays b, Arrays c, Arrays d, Arrays e, Arrays f, Arrays g) => Unlift Acc (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g) Source # 

Methods

unlift :: Acc (Plain (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g)) -> (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g) Source #

(Lift Acc a, Lift Acc b, Lift Acc c, Lift Acc d, Lift Acc e, Lift Acc f, Lift Acc g, Arrays (Plain a), Arrays (Plain b), Arrays (Plain c), Arrays (Plain d), Arrays (Plain e), Arrays (Plain f), Arrays (Plain g)) => Lift Acc (a, b, c, d, e, f, g) Source # 

Associated Types

type Plain (a, b, c, d, e, f, g) :: * Source #

Methods

lift :: (a, b, c, d, e, f, g) -> Acc (Plain (a, b, c, d, e, f, g)) Source #

(Arrays a, Arrays b, Arrays c, Arrays d, Arrays e, Arrays f, Arrays g, Arrays h) => Unlift Acc (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h) Source # 

Methods

unlift :: Acc (Plain (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h)) -> (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h) Source #

(Lift Acc a, Lift Acc b, Lift Acc c, Lift Acc d, Lift Acc e, Lift Acc f, Lift Acc g, Lift Acc h, Arrays (Plain a), Arrays (Plain b), Arrays (Plain c), Arrays (Plain d), Arrays (Plain e), Arrays (Plain f), Arrays (Plain g), Arrays (Plain h)) => Lift Acc (a, b, c, d, e, f, g, h) Source # 

Associated Types

type Plain (a, b, c, d, e, f, g, h) :: * Source #

Methods

lift :: (a, b, c, d, e, f, g, h) -> Acc (Plain (a, b, c, d, e, f, g, h)) Source #

(Arrays a, Arrays b, Arrays c, Arrays d, Arrays e, Arrays f, Arrays g, Arrays h, Arrays i) => Unlift Acc (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h, Acc i) Source # 

Methods

unlift :: Acc (Plain (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h, Acc i)) -> (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h, Acc i) Source #

(Lift Acc a, Lift Acc b, Lift Acc c, Lift Acc d, Lift Acc e, Lift Acc f, Lift Acc g, Lift Acc h, Lift Acc i, Arrays (Plain a), Arrays (Plain b), Arrays (Plain c), Arrays (Plain d), Arrays (Plain e), Arrays (Plain f), Arrays (Plain g), Arrays (Plain h), Arrays (Plain i)) => Lift Acc (a, b, c, d, e, f, g, h, i) Source # 

Associated Types

type Plain (a, b, c, d, e, f, g, h, i) :: * Source #

Methods

lift :: (a, b, c, d, e, f, g, h, i) -> Acc (Plain (a, b, c, d, e, f, g, h, i)) Source #

(Arrays a, Arrays b, Arrays c, Arrays d, Arrays e, Arrays f, Arrays g, Arrays h, Arrays i, Arrays j) => Unlift Acc (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h, Acc i, Acc j) Source # 

Methods

unlift :: Acc (Plain (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h, Acc i, Acc j)) -> (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h, Acc i, Acc j) Source #

(Lift Acc a, Lift Acc b, Lift Acc c, Lift Acc d, Lift Acc e, Lift Acc f, Lift Acc g, Lift Acc h, Lift Acc i, Lift Acc j, Arrays (Plain a), Arrays (Plain b), Arrays (Plain c), Arrays (Plain d), Arrays (Plain e), Arrays (Plain f), Arrays (Plain g), Arrays (Plain h), Arrays (Plain i), Arrays (Plain j)) => Lift Acc (a, b, c, d, e, f, g, h, i, j) Source # 

Associated Types

type Plain (a, b, c, d, e, f, g, h, i, j) :: * Source #

Methods

lift :: (a, b, c, d, e, f, g, h, i, j) -> Acc (Plain (a, b, c, d, e, f, g, h, i, j)) Source #

(Arrays a, Arrays b, Arrays c, Arrays d, Arrays e, Arrays f, Arrays g, Arrays h, Arrays i, Arrays j, Arrays k) => Unlift Acc (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h, Acc i, Acc j, Acc k) Source # 

Methods

unlift :: Acc (Plain (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h, Acc i, Acc j, Acc k)) -> (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h, Acc i, Acc j, Acc k) Source #

(Lift Acc a, Lift Acc b, Lift Acc c, Lift Acc d, Lift Acc e, Lift Acc f, Lift Acc g, Lift Acc h, Lift Acc i, Lift Acc j, Lift Acc k, Arrays (Plain a), Arrays (Plain b), Arrays (Plain c), Arrays (Plain d), Arrays (Plain e), Arrays (Plain f), Arrays (Plain g), Arrays (Plain h), Arrays (Plain i), Arrays (Plain j), Arrays (Plain k)) => Lift Acc (a, b, c, d, e, f, g, h, i, j, k) Source # 

Associated Types

type Plain (a, b, c, d, e, f, g, h, i, j, k) :: * Source #

Methods

lift :: (a, b, c, d, e, f, g, h, i, j, k) -> Acc (Plain (a, b, c, d, e, f, g, h, i, j, k)) Source #

(Arrays a, Arrays b, Arrays c, Arrays d, Arrays e, Arrays f, Arrays g, Arrays h, Arrays i, Arrays j, Arrays k, Arrays l) => Unlift Acc (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h, Acc i, Acc j, Acc k, Acc l) Source # 

Methods

unlift :: Acc (Plain (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h, Acc i, Acc j, Acc k, Acc l)) -> (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h, Acc i, Acc j, Acc k, Acc l) Source #

(Lift Acc a, Lift Acc b, Lift Acc c, Lift Acc d, Lift Acc e, Lift Acc f, Lift Acc g, Lift Acc h, Lift Acc i, Lift Acc j, Lift Acc k, Lift Acc l, Arrays (Plain a), Arrays (Plain b), Arrays (Plain c), Arrays (Plain d), Arrays (Plain e), Arrays (Plain f), Arrays (Plain g), Arrays (Plain h), Arrays (Plain i), Arrays (Plain j), Arrays (Plain k), Arrays (Plain l)) => Lift Acc (a, b, c, d, e, f, g, h, i, j, k, l) Source # 

Associated Types

type Plain (a, b, c, d, e, f, g, h, i, j, k, l) :: * Source #

Methods

lift :: (a, b, c, d, e, f, g, h, i, j, k, l) -> Acc (Plain (a, b, c, d, e, f, g, h, i, j, k, l)) Source #

(Arrays a, Arrays b, Arrays c, Arrays d, Arrays e, Arrays f, Arrays g, Arrays h, Arrays i, Arrays j, Arrays k, Arrays l, Arrays m) => Unlift Acc (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h, Acc i, Acc j, Acc k, Acc l, Acc m) Source # 

Methods

unlift :: Acc (Plain (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h, Acc i, Acc j, Acc k, Acc l, Acc m)) -> (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h, Acc i, Acc j, Acc k, Acc l, Acc m) Source #

(Lift Acc a, Lift Acc b, Lift Acc c, Lift Acc d, Lift Acc e, Lift Acc f, Lift Acc g, Lift Acc h, Lift Acc i, Lift Acc j, Lift Acc k, Lift Acc l, Lift Acc m, Arrays (Plain a), Arrays (Plain b), Arrays (Plain c), Arrays (Plain d), Arrays (Plain e), Arrays (Plain f), Arrays (Plain g), Arrays (Plain h), Arrays (Plain i), Arrays (Plain j), Arrays (Plain k), Arrays (Plain l), Arrays (Plain m)) => Lift Acc (a, b, c, d, e, f, g, h, i, j, k, l, m) Source # 

Associated Types

type Plain (a, b, c, d, e, f, g, h, i, j, k, l, m) :: * Source #

Methods

lift :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Acc (Plain (a, b, c, d, e, f, g, h, i, j, k, l, m)) Source #

(Arrays a, Arrays b, Arrays c, Arrays d, Arrays e, Arrays f, Arrays g, Arrays h, Arrays i, Arrays j, Arrays k, Arrays l, Arrays m, Arrays n) => Unlift Acc (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h, Acc i, Acc j, Acc k, Acc l, Acc m, Acc n) Source # 

Methods

unlift :: Acc (Plain (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h, Acc i, Acc j, Acc k, Acc l, Acc m, Acc n)) -> (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h, Acc i, Acc j, Acc k, Acc l, Acc m, Acc n) Source #

(Lift Acc a, Lift Acc b, Lift Acc c, Lift Acc d, Lift Acc e, Lift Acc f, Lift Acc g, Lift Acc h, Lift Acc i, Lift Acc j, Lift Acc k, Lift Acc l, Lift Acc m, Lift Acc n, Arrays (Plain a), Arrays (Plain b), Arrays (Plain c), Arrays (Plain d), Arrays (Plain e), Arrays (Plain f), Arrays (Plain g), Arrays (Plain h), Arrays (Plain i), Arrays (Plain j), Arrays (Plain k), Arrays (Plain l), Arrays (Plain m), Arrays (Plain n)) => Lift Acc (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source # 

Associated Types

type Plain (a, b, c, d, e, f, g, h, i, j, k, l, m, n) :: * Source #

Methods

lift :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Acc (Plain (a, b, c, d, e, f, g, h, i, j, k, l, m, n)) Source #

(Arrays a, Arrays b, Arrays c, Arrays d, Arrays e, Arrays f, Arrays g, Arrays h, Arrays i, Arrays j, Arrays k, Arrays l, Arrays m, Arrays n, Arrays o) => Unlift Acc (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h, Acc i, Acc j, Acc k, Acc l, Acc m, Acc n, Acc o) Source # 

Methods

unlift :: Acc (Plain (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h, Acc i, Acc j, Acc k, Acc l, Acc m, Acc n, Acc o)) -> (Acc a, Acc b, Acc c, Acc d, Acc e, Acc f, Acc g, Acc h, Acc i, Acc j, Acc k, Acc l, Acc m, Acc n, Acc o) Source #

(Lift Acc a, Lift Acc b, Lift Acc c, Lift Acc d, Lift Acc e, Lift Acc f, Lift Acc g, Lift Acc h, Lift Acc i, Lift Acc j, Lift Acc k, Lift Acc l, Lift Acc m, Lift Acc n, Lift Acc o, Arrays (Plain a), Arrays (Plain b), Arrays (Plain c), Arrays (Plain d), Arrays (Plain e), Arrays (Plain f), Arrays (Plain g), Arrays (Plain h), Arrays (Plain i), Arrays (Plain j), Arrays (Plain k), Arrays (Plain l), Arrays (Plain m), Arrays (Plain n), Arrays (Plain o)) => Lift Acc (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source # 

Associated Types

type Plain (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) :: * Source #

Methods

lift :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Acc (Plain (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)) Source #

type EltT Acc a Source # 
type EltT Acc a = Arrays a
type Plain (Acc a) Source # 
type Plain (Acc a) = a

class (Typeable a, Typeable (ArrRepr a)) => Arrays a Source #

Arrays consists of nested tuples of individual Arrays, currently up to 15-elements wide. Accelerate computations can thereby return multiple results.

Minimal complete definition

arrays, flavour, toArr, fromArr

Instances

Arrays () Source # 

Methods

arrays :: () -> ArraysR (ArrRepr ())

flavour :: () -> ArraysFlavour ()

toArr :: ArrRepr () -> ()

fromArr :: () -> ArrRepr ()

(Arrays a, Arrays b) => Arrays (a, b) Source # 

Methods

arrays :: (a, b) -> ArraysR (ArrRepr (a, b))

flavour :: (a, b) -> ArraysFlavour (a, b)

toArr :: ArrRepr (a, b) -> (a, b)

fromArr :: (a, b) -> ArrRepr (a, b)

(Shape sh, Elt e) => Arrays (Array sh e) Source # 

Methods

arrays :: Array sh e -> ArraysR (ArrRepr (Array sh e))

flavour :: Array sh e -> ArraysFlavour (Array sh e)

toArr :: ArrRepr (Array sh e) -> Array sh e

fromArr :: Array sh e -> ArrRepr (Array sh e)

(Arrays a, Arrays b, Arrays c) => Arrays (a, b, c) Source # 

Methods

arrays :: (a, b, c) -> ArraysR (ArrRepr (a, b, c))

flavour :: (a, b, c) -> ArraysFlavour (a, b, c)

toArr :: ArrRepr (a, b, c) -> (a, b, c)

fromArr :: (a, b, c) -> ArrRepr (a, b, c)

(Arrays a, Arrays b, Arrays c, Arrays d) => Arrays (a, b, c, d) Source # 

Methods

arrays :: (a, b, c, d) -> ArraysR (ArrRepr (a, b, c, d))

flavour :: (a, b, c, d) -> ArraysFlavour (a, b, c, d)

toArr :: ArrRepr (a, b, c, d) -> (a, b, c, d)

fromArr :: (a, b, c, d) -> ArrRepr (a, b, c, d)

(Arrays a, Arrays b, Arrays c, Arrays d, Arrays e) => Arrays (a, b, c, d, e) Source # 

Methods

arrays :: (a, b, c, d, e) -> ArraysR (ArrRepr (a, b, c, d, e))

flavour :: (a, b, c, d, e) -> ArraysFlavour (a, b, c, d, e)

toArr :: ArrRepr (a, b, c, d, e) -> (a, b, c, d, e)

fromArr :: (a, b, c, d, e) -> ArrRepr (a, b, c, d, e)

(Arrays a, Arrays b, Arrays c, Arrays d, Arrays e, Arrays f) => Arrays (a, b, c, d, e, f) Source # 

Methods

arrays :: (a, b, c, d, e, f) -> ArraysR (ArrRepr (a, b, c, d, e, f))

flavour :: (a, b, c, d, e, f) -> ArraysFlavour (a, b, c, d, e, f)

toArr :: ArrRepr (a, b, c, d, e, f) -> (a, b, c, d, e, f)

fromArr :: (a, b, c, d, e, f) -> ArrRepr (a, b, c, d, e, f)

(Arrays a, Arrays b, Arrays c, Arrays d, Arrays e, Arrays f, Arrays g) => Arrays (a, b, c, d, e, f, g) Source # 

Methods

arrays :: (a, b, c, d, e, f, g) -> ArraysR (ArrRepr (a, b, c, d, e, f, g))

flavour :: (a, b, c, d, e, f, g) -> ArraysFlavour (a, b, c, d, e, f, g)

toArr :: ArrRepr (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g)

fromArr :: (a, b, c, d, e, f, g) -> ArrRepr (a, b, c, d, e, f, g)

(Arrays a, Arrays b, Arrays c, Arrays d, Arrays e, Arrays f, Arrays g, Arrays h) => Arrays (a, b, c, d, e, f, g, h) Source # 

Methods

arrays :: (a, b, c, d, e, f, g, h) -> ArraysR (ArrRepr (a, b, c, d, e, f, g, h))

flavour :: (a, b, c, d, e, f, g, h) -> ArraysFlavour (a, b, c, d, e, f, g, h)

toArr :: ArrRepr (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h)

fromArr :: (a, b, c, d, e, f, g, h) -> ArrRepr (a, b, c, d, e, f, g, h)

(Arrays a, Arrays b, Arrays c, Arrays d, Arrays e, Arrays f, Arrays g, Arrays h, Arrays i) => Arrays (a, b, c, d, e, f, g, h, i) Source # 

Methods

arrays :: (a, b, c, d, e, f, g, h, i) -> ArraysR (ArrRepr (a, b, c, d, e, f, g, h, i))

flavour :: (a, b, c, d, e, f, g, h, i) -> ArraysFlavour (a, b, c, d, e, f, g, h, i)

toArr :: ArrRepr (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i)

fromArr :: (a, b, c, d, e, f, g, h, i) -> ArrRepr (a, b, c, d, e, f, g, h, i)

(Arrays a, Arrays b, Arrays c, Arrays d, Arrays e, Arrays f, Arrays g, Arrays h, Arrays i, Arrays j) => Arrays (a, b, c, d, e, f, g, h, i, j) Source # 

Methods

arrays :: (a, b, c, d, e, f, g, h, i, j) -> ArraysR (ArrRepr (a, b, c, d, e, f, g, h, i, j))

flavour :: (a, b, c, d, e, f, g, h, i, j) -> ArraysFlavour (a, b, c, d, e, f, g, h, i, j)

toArr :: ArrRepr (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j)

fromArr :: (a, b, c, d, e, f, g, h, i, j) -> ArrRepr (a, b, c, d, e, f, g, h, i, j)

(Arrays a, Arrays b, Arrays c, Arrays d, Arrays e, Arrays f, Arrays g, Arrays h, Arrays i, Arrays j, Arrays k) => Arrays (a, b, c, d, e, f, g, h, i, j, k) Source # 

Methods

arrays :: (a, b, c, d, e, f, g, h, i, j, k) -> ArraysR (ArrRepr (a, b, c, d, e, f, g, h, i, j, k))

flavour :: (a, b, c, d, e, f, g, h, i, j, k) -> ArraysFlavour (a, b, c, d, e, f, g, h, i, j, k)

toArr :: ArrRepr (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k)

fromArr :: (a, b, c, d, e, f, g, h, i, j, k) -> ArrRepr (a, b, c, d, e, f, g, h, i, j, k)

(Arrays a, Arrays b, Arrays c, Arrays d, Arrays e, Arrays f, Arrays g, Arrays h, Arrays i, Arrays j, Arrays k, Arrays l) => Arrays (a, b, c, d, e, f, g, h, i, j, k, l) Source # 

Methods

arrays :: (a, b, c, d, e, f, g, h, i, j, k, l) -> ArraysR (ArrRepr (a, b, c, d, e, f, g, h, i, j, k, l))

flavour :: (a, b, c, d, e, f, g, h, i, j, k, l) -> ArraysFlavour (a, b, c, d, e, f, g, h, i, j, k, l)

toArr :: ArrRepr (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l)

fromArr :: (a, b, c, d, e, f, g, h, i, j, k, l) -> ArrRepr (a, b, c, d, e, f, g, h, i, j, k, l)

(Arrays a, Arrays b, Arrays c, Arrays d, Arrays e, Arrays f, Arrays g, Arrays h, Arrays i, Arrays j, Arrays k, Arrays l, Arrays m) => Arrays (a, b, c, d, e, f, g, h, i, j, k, l, m) Source # 

Methods

arrays :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> ArraysR (ArrRepr (a, b, c, d, e, f, g, h, i, j, k, l, m))

flavour :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> ArraysFlavour (a, b, c, d, e, f, g, h, i, j, k, l, m)

toArr :: ArrRepr (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m)

fromArr :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> ArrRepr (a, b, c, d, e, f, g, h, i, j, k, l, m)

(Arrays a, Arrays b, Arrays c, Arrays d, Arrays e, Arrays f, Arrays g, Arrays h, Arrays i, Arrays j, Arrays k, Arrays l, Arrays m, Arrays n) => Arrays (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source # 

Methods

arrays :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> ArraysR (ArrRepr (a, b, c, d, e, f, g, h, i, j, k, l, m, n))

flavour :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> ArraysFlavour (a, b, c, d, e, f, g, h, i, j, k, l, m, n)

toArr :: ArrRepr (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n)

fromArr :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> ArrRepr (a, b, c, d, e, f, g, h, i, j, k, l, m, n)

(Arrays a, Arrays b, Arrays c, Arrays d, Arrays e, Arrays f, Arrays g, Arrays h, Arrays i, Arrays j, Arrays k, Arrays l, Arrays m, Arrays n, Arrays o) => Arrays (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source # 

Methods

arrays :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> ArraysR (ArrRepr (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o))

flavour :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> ArraysFlavour (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)

toArr :: ArrRepr (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)

fromArr :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> ArrRepr (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)

run :: Arrays a => Acc a -> a Source #

Run a complete embedded array program using the reference interpreter.

run1 :: (Arrays a, Arrays b) => (Acc a -> Acc b) -> a -> b Source #

This is runN specialised to an array program of one argument.

runN :: Afunction f => f -> AfunctionR f Source #

Prepare and execute an embedded array program.