The accelerate package

Data.Array.Accelerate defines an embedded array language for computations
for high-performance computing in Haskell. Computations on multi-dimensional,
regular arrays are expressed in the form of parameterised collective
operations, such as maps, reductions, and permutations. These computations may
then be online compiled and executed on a range of architectures.

A simple example

As a simple example, consider the computation of a dot product of two vectors
of floating point numbers:

Except for the type, this code is almost the same as the corresponding Haskell
code on lists of floats. The types indicate that the computation may be
online-compiled for performance – for example, using
Data.Array.Accelerate.CUDA it may be on-the-fly off-loaded to the GPU.

Available backends

Currently, there are two backends:

An interpreter that serves as a reference implementation of the intended
semantics of the language, which is included in this package.

Flags

Name

Description

Default

Type

debug

Enable tracing message flags. These are read from the command-line
arguments, which is convenient but may cause problems interacting with the
user program, so are disabled by default. The available options are:

-ddump-sharing: print sharing recovery information

-ddump-simpl-stats: dump statistics counts from the simplifier phase

-ddump-simpl-iterations: dump the program after each iteration of the simplifier

-dverbose: other, uncategorised messages

Enabled

Automatic

more-pp

Enable HTML and Graphviz pretty printing.

Disabled

Automatic

bounds-checks

Enable bounds checking

Enabled

Automatic

unsafe-checks

Enable bounds checking in unsafe operations

Disabled

Automatic

internal-checks

Enable internal consistency checks

Disabled

Automatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info