Safe Haskell | None |
---|---|
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, Buildable rep, ExpDec rep ~ (), Op rep ~ SOAC rep) => Pat rep -> (SubExp, [Reduce rep], LambdaT rep, [VName]) -> m (Stm rep, Stm rep)
- dissectScrema :: (MonadBuilder m, Op (Rep m) ~ SOAC (Rep m), Buildable (Rep m)) => Pat (Rep m) -> SubExp -> ScremaForm (Rep m) -> [VName] -> m ()
- sequentialStreamWholeArray :: (MonadBuilder m, Buildable (Rep m)) => Pat (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, Buildable rep, ExpDec rep ~ (), Op rep ~ SOAC rep) => Pat rep -> (SubExp, [Reduce rep], LambdaT rep, [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
.
dissectScrema :: (MonadBuilder m, Op (Rep m) ~ SOAC (Rep m), Buildable (Rep m)) => Pat (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 :: (MonadBuilder m, Buildable (Rep m)) => Pat (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.