Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
An unstructured grab-bag of various tools and inspection functions that didn't really fit anywhere else.
Synopsis
- module Futhark.Construct
- redomapToMapAndReduce :: (MonadFreshNames m, Bindable rep, ExpDec rep ~ (), Op rep ~ SOAC rep) => Pattern rep -> (SubExp, Commutativity, LambdaT rep, LambdaT rep, [SubExp], [VName]) -> m (Stm rep, Stm rep)
- dissectScrema :: (MonadBinder m, Op (Rep m) ~ SOAC (Rep m), Bindable (Rep m)) => Pattern (Rep m) -> SubExp -> ScremaForm (Rep m) -> [VName] -> m ()
- sequentialStreamWholeArray :: (MonadBinder m, Bindable (Rep m)) => Pattern (Rep m) -> SubExp -> [SubExp] -> LambdaT (Rep m) -> [VName] -> m ()
- partitionChunkedFoldParameters :: Int -> [Param dec] -> (Param dec, [Param dec], [Param dec])
- module Futhark.Analysis.PrimExp.Convert
Documentation
module Futhark.Construct
redomapToMapAndReduce :: (MonadFreshNames m, Bindable rep, ExpDec rep ~ (), Op rep ~ SOAC rep) => Pattern rep -> (SubExp, Commutativity, LambdaT rep, LambdaT rep, [SubExp], [VName]) -> m (Stm rep, Stm rep) Source #
Turns a binding of a redomap
into two seperate bindings, a
map
binding and a reduce
binding (returned in that order).
Reuses the original pattern for the reduce
, and creates a new
pattern with new Ident
s for the result of the map
.
Only handles a pattern with an empty patternContextElements
.
dissectScrema :: (MonadBinder m, Op (Rep m) ~ SOAC (Rep m), Bindable (Rep m)) => Pattern (Rep m) -> SubExp -> ScremaForm (Rep m) -> [VName] -> m () Source #
Turn a Screma into a Scanomap (possibly with mapout parts) and a Redomap. This is used to handle Scremas that are so complicated that we cannot directly generate efficient parallel code for them. In essense, what happens is the opposite of horisontal fusion.
sequentialStreamWholeArray :: (MonadBinder m, Bindable (Rep m)) => Pattern (Rep m) -> SubExp -> [SubExp] -> LambdaT (Rep m) -> [VName] -> m () Source #
Turn a stream SOAC into statements that apply the stream lambda to the entire input.
partitionChunkedFoldParameters :: Int -> [Param dec] -> (Param dec, [Param dec], [Param dec]) Source #
Split the parameters of a stream reduction lambda into the chunk size parameter, the accumulator parameters, and the input chunk parameters. The integer argument is how many accumulators are used.