Safe Haskell | None |
---|
Data.Array.Parallel.Unlifted.Distributed.Primitive.DPrim
Description
Distribution of values of primitive types.
- class Unbox e => DPrim e where
- primIndexD :: DPrim a => String -> Dist a -> Int -> a
- primNewMD :: DPrim a => Gang -> ST s (MDist a s)
- primReadMD :: DPrim a => MDist a s -> Int -> ST s a
- primWriteMD :: DPrim a => MDist a s -> Int -> a -> ST s ()
- primUnsafeFreezeMD :: DPrim a => MDist a s -> ST s (Dist a)
- primSizeD :: DPrim a => Dist a -> Int
- primSizeMD :: DPrim a => MDist a s -> Int
Documentation
class Unbox e => DPrim e where
For distributed primitive values, we can just store all the members in a vector. The vector has the same length as the number of threads in the gang.
primIndexD :: DPrim a => String -> Dist a -> Int -> a
Get the member corresponding to a thread index.
primNewMD :: DPrim a => Gang -> ST s (MDist a s)
Create a new distributed value, having as many members as threads
in the given Gang
.
primReadMD :: DPrim a => MDist a s -> Int -> ST s a
Read the member of a distributed value corresponding to the given thread index.
primWriteMD :: DPrim a => MDist a s -> Int -> a -> ST s ()
Write the member of a distributed value corresponding to the given thread index.
primUnsafeFreezeMD :: DPrim a => MDist a s -> ST s (Dist a)
Freeze a mutable distributed value to an immutable one. You promise not to update the mutable one any further.
primSizeD :: DPrim a => Dist a -> Int
Get the size of a distributed value, that is, the number of threads in the gang that it was created for.
primSizeMD :: DPrim a => MDist a s -> Int
Get the size of a distributed mutable value, that is, the number of threads in the gang it was created for.