ConcurrentUtils-0.3.0.0: Concurrent utilities

Safe HaskellNone
LanguageHaskell98

Control.CUtils.DataParallel

Description

An implementation of nested data parallelism

Synopsis

Documentation

data ArrC t Source

Instances

newArray :: [e] -> Array Int e Source

data A t u where Source

Constructors for caller's use

Constructors

Count :: A Int (ArrC Int) 
Index :: A (ArrC t, Int) t 
Zip :: A (ArrC t, ArrC u) (ArrC (t, u)) 
Unzip :: A (ArrC (t, u)) (ArrC t, ArrC u) 
Concat :: A (ArrC (ArrC t)) (ArrC t) 
Map :: A t u -> A (ArrC t) (ArrC u) 
Comp :: A u v -> A t u -> A t v 
Arr :: (t -> u) -> A t u 
Prod :: A t u -> A v w -> A (t, v) (u, w) 
Sum :: A t u -> A v w -> A (Either t v) (Either u w) 

Instances

optimize :: A a v -> A a v Source

Optimizes an arrow for parallel execution. The arrow can be optimized once, and the result saved for multiple computations. (The exact output of the optimizer is subject to change.)

The arrow must be finitely examinable.

eval :: A t u -> t -> u Source

Evaluates arrows.