Safe Haskell | Safe |
---|
The CreateST2Array
instrument is stateless and provides a similar
interface to parallelMP
. The difference is that it produces the
new array in a specific pass.
- data CreateST2Array r w p1 tc
- createST2Array :: (Ix i, Num i, Monad p1) => CreateST2Array r w p1 tc -> NumThreads -> (i, i) -> (i -> MultiPass r w tc (p1 a)) -> MultiPass r w tc (p1 (ST2Array r w i a))
- pmapST2ArrayMP :: (Ix i, Num i, Monad p1) => CreateST2Array r w p1 tc -> NumThreads -> ST2Array r w i a -> (a -> MultiPass r w tc (p1 b)) -> MultiPass r w tc (p1 (ST2Array r w i b))
Documentation
data CreateST2Array r w p1 tc Source
Abstract datatype for the instrument.
Instrument tc () () (CreateST2Array r w On tc) | |
Instrument tc () () (CreateST2Array r w Off tc) |
:: (Ix i, Num i, Monad p1) | |
=> CreateST2Array r w p1 tc |
|
-> NumThreads | Number of threads to spawn |
-> (i, i) | Element range |
-> (i -> MultiPass r w tc (p1 a)) | Initialisation function |
-> MultiPass r w tc (p1 (ST2Array r w i a)) | New array |
Create a new array during pass p1
, using the initialisation
function to initialise the elements. The initialisation is done in
parallel, using the specified number of threads.
:: (Ix i, Num i, Monad p1) | |
=> CreateST2Array r w p1 tc |
|
-> NumThreads | Number of threads to spawn |
-> ST2Array r w i a | Input array |
-> (a -> MultiPass r w tc (p1 b)) | Function to apply to each element |
-> MultiPass r w tc (p1 (ST2Array r w i b)) | Output array |
pmapST2ArrayMP
is a simple application of createST2Array
. It
provides a similar interface to
mapST2ArrayMP
. The difference is
that it only executes the map operation once the specified pass is
reached.