An Embedded Language for Accelerated Array Computations

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

For more details, please have a look at our recent paper Accelerating Haskell Array Codes with Multicore GPUs. There are some slightly outdated slides and a video of a talk that I gave at the Haskell Implementors Workshop 2009 (in Edinburgh): Haskell Arrays, Accelerated (Using GPUs).

A simple example

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

  dotp :: Acc (Vector Float) -> Acc (Vector Float) -> Acc (Scalar Float)
  dotp xs ys = fold (+) 0 (zipWith (*) xs ys)

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 is off-loaded to a GPU.


Mailing list

Both user and developer questions and discussions are welcome at (Google Groups page).


Haddock documentation is included in the package and linked from the Hackage page. Furthermore, the source package contains a few simple examples in the accelerate-examples/ directory.


The idea behind the HOAS (higher-order abstract syntax) to de-Bruijn conversion used in the library is described separately.

The PLS Accelerate Team (alphabetically)

Further contributions by Ben Lever, Rami Mukhtar, and Sean Seefried.

• Copyright [2009..2011] Manuel M T Chakravarty • Last modified: 17 April 2011