3 | | The NDP part of the compiler is made up of two components: a parallel array [wiki:DataParallel/Library library] and [wiki:DataParallel/CodeVectorisation code vectorisation], a transformation which eliminates nested parallelism. The library defines the type of parallel arrays, supporting operations and typeclasses and a loop fusion framework. Crucially, the actual representation of a parallel array is determined by the type of its elements. For instance, `[:Int:]` is just an array of unboxed `Int`s whereas `[:(a,b):]` is, essentially, a pair of arrays `([:a:],[:b:])`. [wiki:TypeFunctions Associated data types and type synonyms] allow us to implement this entirely in the library, without having to modify the compiler. In contrast to this, [wiki:DataParallel/CodeVectorisation code vectorisation] is implemented as a Core-to-Core transformation in GHC. In order to be able to deal with higher-order functions in parallel contexts, we also perform [wiki:DataParallel/ClosureConversion closure conversion]; it is not entirely clear yet whether we want to do it together with [wiki:DataParallel/CodeVectorisation code vectorisation] or have two separate passes. |
| 4 | The NDP part of the compiler is made up of two components: a parallel array [wiki:DataParallel/Library library] and [wiki:DataParallel/CodeVectorisation code vectorisation], a transformation which eliminates nested parallelism. The library defines the type of parallel arrays, supporting operations and typeclasses and a loop fusion framework. Crucially, the actual representation of a parallel array is determined by the type of its elements. For instance, `[:Int:]` is just an array of unboxed `Int`s whereas `[:(a,b):]` is, essentially, a pair of arrays `([:a:],[:b:])`. [wiki:TypeFunctions Associated data types and type synonyms] allow us to implement this entirely in the library, without having to modify the compiler. In contrast to this, [wiki:DataParallel/CodeVectorisation code vectorisation] is implemented as a Core-to-Core transformation in GHC. In order to be able to deal with higher-order functions in parallel contexts, we also perform [wiki:DataParallel/ClosureConversion closure conversion] as part of [wiki:DataParallel/CodeVectorisation code vectorisation]. |