repa- High performance, regular, shape polymorphic parallel arrays.

Safe HaskellNone



Gang Primitives.



theGang :: Gang #

This globally shared gang is auto-initialised at startup and shared by all Repa computations.

In a data parallel setting, it does not help to have multiple gangs running at the same time. This is because a single data parallel computation should already be able to keep all threads busy. If we had multiple gangs running at the same time, then the system as a whole would run slower as the gangs would contend for cache and thrash the scheduler.

If, due to laziness or otherwise, you try to start multiple parallel Repa computations at the same time, then you will get the following warning on stderr at runtime:

Data.Array.Repa: Performing nested parallel computation sequentially.
    You've probably called the compute or copy function while another
    instance was already running. This can happen if the second version
    was suspended due to lazy evaluation. Use deepSeqArray to ensure that
    each array is fully evaluated before you compute the next one.

data Gang #

A Gang is a group of threads that execute arbitrary work requests.


Show Gang # 


showsPrec :: Int -> Gang -> ShowS #

show :: Gang -> String #

showList :: [Gang] -> ShowS #

forkGang :: Int -> IO Gang #

Fork a Gang with the given number of threads (at least 1).

gangSize :: Gang -> Int #

O(1). Yield the number of threads in the Gang.

gangIO :: Gang -> (Int -> IO ()) -> IO () #

Issue work requests for the Gang and wait until they complete.

If the gang is already busy then print a warning to stderr and just run the actions sequentially in the requesting thread.

gangST :: Gang -> (Int -> ST s ()) -> ST s () #

Same as gangIO but in the ST monad.