dph-prim-par-0.7.0.1: Data Parallel Haskell segmented arrays. (production version)

Safe HaskellNone

Data.Array.Parallel.Unlifted.Distributed.Combinators

Description

Standard combinators for distributed types.

Synopsis

Documentation

data What Source

What sort of thing is being computed.

Instances

imapDSource

Arguments

:: (DT a, DT b) 
=> What

What is the worker function doing.

-> Gang 
-> (Int -> a -> b) 
-> Dist a 
-> Dist b 

Map a function across all elements of a distributed value. The worker function also gets the current thread index. As opposed to imapD' this version also deepSeqs each element before passing it to the function.

mapDSource

Arguments

:: (DT a, DT b) 
=> What

What is the worker function doing.

-> Gang 
-> (a -> b) 
-> Dist a 
-> Dist b 

Map a function to every instance of a distributed value.

This applies the function to every thread, but not every value held by the thread. If you want that then use something like:

mapD theGang (V.map (+ 1)) :: Dist (Vector Int) -> Dist (Vector Int)

zipD :: (DT a, DT b) => Dist a -> Dist b -> Dist (a, b)Source

Pairing of distributed values. The two values must belong to the same Gang.

unzipD :: (DT a, DT b) => Dist (a, b) -> (Dist a, Dist b)Source

Unpairing of distributed values.

fstD :: (DT a, DT b) => Dist (a, b) -> Dist aSource

Extract the first elements of a distributed pair.

sndD :: (DT a, DT b) => Dist (a, b) -> Dist bSource

Extract the second elements of a distributed pair.

zipWithDSource

Arguments

:: (DT a, DT b, DT c) 
=> What

What is the worker function doing.

-> Gang 
-> (a -> b -> c) 
-> Dist a 
-> Dist b 
-> Dist c 

Combine two distributed values with the given function.

izipWithDSource

Arguments

:: (DT a, DT b, DT c) 
=> What

What is the worker function doing.

-> Gang 
-> (Int -> a -> b -> c) 
-> Dist a 
-> Dist b 
-> Dist c 

Combine two distributed values with the given function. The worker function also gets the index of the current thread.

foldD :: DT a => What -> Gang -> (a -> a -> a) -> Dist a -> aSource

Fold all the instances of a distributed value.

scanD :: forall a. DT a => What -> Gang -> (a -> a -> a) -> a -> Dist a -> (Dist a, a)Source

Prefix sum of the instances of a distributed value.

mapAccumLD :: forall a b acc. (DT a, DT b) => Gang -> (acc -> a -> (acc, b)) -> acc -> Dist a -> (acc, Dist b)Source

Combination of map and fold.