accelerate-0.9.0.1: An embedded language for accelerated array processing

Portabilitynon-portable (GHC extensions)
Stabilityexperimental
MaintainerManuel M T Chakravarty <chak@cse.unsw.edu.au>
Safe HaskellNone

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.

Surface types versus representation types

As a general rule, we perform all computations on representation types and we store all data as values of representation types. To guarantee the type safety of the interpreter, this currently implies a lot of conversions between surface and representation types. Optimising the code by eliminating back and forth conversions is fine, but only where it doesn't negatively affects clarity — after all, the main purpose of the interpreter is to serve as an executable specification.

Synopsis

Interpret an array expression

class (Delayable arrs, Typeable arrs) => Arrays arrs Source

Tuples of arrays (of type 'Array dim e'). This characterises the domain of results of Accelerate array computations.

Instances

Arrays () 
(Arrays arrs1, Arrays arrs2) => Arrays (arrs1, arrs2) 
(Shape sh, Elt e) => Arrays (Array sh e) 

run :: Arrays a => Acc a -> aSource

Run a complete embedded array program using the reference interpreter.

stream :: (Arrays a, Arrays b) => (Acc a -> Acc b) -> [a] -> [b]Source

Stream a lazily read list of input arrays through the given program, collecting results as we go