dph-seq-0.5.1.1: Data structures for Nested Data-Parallel Haskell.

Data.Array.Parallel

Contents

Description

User level interface of parallel arrays.

The semantic difference between standard Haskell arrays (aka lazy arrays) and parallel arrays (aka strict arrays) is that the evaluation of two different elements of a lazy array is independent, whereas in a strict array either non or all elements are evaluated. In other words, when a parallel array is evaluated to WHNF, all its elements will be evaluated to WHNF. The name parallel array indicates that all array elements may, in general, be evaluated to WHNF in parallel without any need to resort to speculative evaluation. This parallel evaluation semantics is also beneficial in the sequential case, as it facilitates loop-based array processing as known from classic array-based languages, such as Fortran.

The interface of this module is essentially a variant of the list component of the Prelude, but also includes some functions (such as permutations) that are not provided for lists. The following list of operations are not supported on parallel arrays, as they would require the infinite parallel arrays: iterate, repeat, and cycle.

WARNING: In the current implementation, the functionality provided in this module is tied to the vectoriser pass of GHC invoked by passing the `-fvectorise` option. Without vectorisation these functions will not work at all!

Synopsis

Documentation

Operations on parallel arrays '[::]'

emptyP :: [:a:]Source

singletonP :: a -> [:a:]Source

replicateP :: Int -> a -> [:a:]Source

lengthP :: [:a:] -> IntSource

(!:) :: [:a:] -> Int -> aSource

(+:+) :: [:a:] -> [:a:] -> [:a:]Source

concatP :: [:[:a:]:] -> [:a:]Source

mapP :: (a -> b) -> [:a:] -> [:b:]Source

filterP :: (a -> Bool) -> [:a:] -> [:a:]Source

combineP :: [:a:] -> [:a:] -> [:Int:] -> [:a:]Source

zipP :: [:a:] -> [:b:] -> [:(a, b):]Source

unzipP :: [:(a, b):] -> ([:a:], [:b:])Source

zipWithP :: (a -> b -> c) -> [:a:] -> [:b:] -> [:c:]Source

bpermuteP :: [:a:] -> [:Int:] -> [:a:]Source

updateP :: [:a:] -> [:(Int, a):] -> [:a:]Source

indexedP :: [:a:] -> [:(Int, a):]Source

sliceP :: Int -> Int -> [:e:] -> [:e:]Source

crossMapP :: [:a:] -> (a -> [:b:]) -> [:(a, b):]Source

Conversions

toPArrayP :: [:a:] -> PArray aSource