Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Target = (PatT Type, Result)
- data Targets
- ppTargets :: Targets -> String
- singleTarget :: Target -> Targets
- outerTarget :: Targets -> Target
- innerTarget :: Targets -> Target
- pushInnerTarget :: Target -> Targets -> Targets
- popInnerTarget :: Targets -> Maybe (Target, Targets)
- targetsScope :: DistRep rep => Targets -> Scope rep
- data LoopNesting = MapNesting {
- loopNestingPat :: PatT Type
- loopNestingAux :: StmAux ()
- loopNestingWidth :: SubExp
- loopNestingParamsAndArrs :: [(Param Type, VName)]
- ppLoopNesting :: LoopNesting -> String
- scopeOfLoopNesting :: LParamInfo rep ~ Type => LoopNesting -> Scope rep
- data Nesting = Nesting {}
- type Nestings = (Nesting, [Nesting])
- ppNestings :: Nestings -> String
- letBindInInnerNesting :: Names -> Nestings -> Nestings
- singleNesting :: Nesting -> Nestings
- pushInnerNesting :: Nesting -> Nestings -> Nestings
- type KernelNest = (LoopNesting, [LoopNesting])
- ppKernelNest :: KernelNest -> String
- newKernel :: LoopNesting -> KernelNest
- innermostKernelNesting :: KernelNest -> LoopNesting
- pushKernelNesting :: Target -> LoopNesting -> KernelNest -> KernelNest
- pushInnerKernelNesting :: Target -> LoopNesting -> KernelNest -> KernelNest
- scopeOfKernelNest :: LParamInfo rep ~ Type => KernelNest -> Scope rep
- kernelNestLoops :: KernelNest -> [LoopNesting]
- kernelNestWidths :: KernelNest -> [SubExp]
- boundInKernelNest :: KernelNest -> Names
- boundInKernelNests :: KernelNest -> [Names]
- flatKernel :: MonadFreshNames m => KernelNest -> m ([(VName, SubExp)], [KernelInput])
- constructKernel :: (DistRep rep, MonadFreshNames m, LocalScope rep m) => MkSegLevel rep m -> KernelNest -> Body rep -> m (Stm rep, Stms rep)
- tryDistribute :: (DistRep rep, MonadFreshNames m, LocalScope rep m, MonadLogger m) => MkSegLevel rep m -> Nestings -> Targets -> Stms rep -> m (Maybe (Targets, Stms rep))
- tryDistributeStm :: (MonadFreshNames m, HasScope t m, ASTRep rep) => Nestings -> Targets -> Stm rep -> m (Maybe (Result, Targets, KernelNest))
Documentation
First pair element is the very innermost ("current") target. In
the list, the outermost target comes first. Invariant: Every
element of a pattern must be present as the result of the
immediately enclosing target. This is ensured by pushInnerTarget
by removing unused pattern elements.
singleTarget :: Target -> Targets Source #
outerTarget :: Targets -> Target Source #
innerTarget :: Targets -> Target Source #
data LoopNesting Source #
MapNesting | |
|
Instances
Show LoopNesting Source # | |
Defined in Futhark.Pass.ExtractKernels.Distribution showsPrec :: Int -> LoopNesting -> ShowS # show :: LoopNesting -> String # showList :: [LoopNesting] -> ShowS # | |
FreeIn LoopNesting Source # | |
Defined in Futhark.Pass.ExtractKernels.Distribution freeIn' :: LoopNesting -> FV Source # |
ppLoopNesting :: LoopNesting -> String Source #
scopeOfLoopNesting :: LParamInfo rep ~ Type => LoopNesting -> Scope rep Source #
ppNestings :: Nestings -> String Source #
singleNesting :: Nesting -> Nestings Source #
type KernelNest = (LoopNesting, [LoopNesting]) Source #
Note: first element is *outermost* nesting. This is different from the similar types elsewhere!
ppKernelNest :: KernelNest -> String Source #
newKernel :: LoopNesting -> KernelNest Source #
innermostKernelNesting :: KernelNest -> LoopNesting Source #
Retrieve the innermost kernel nesting.
pushKernelNesting :: Target -> LoopNesting -> KernelNest -> KernelNest Source #
Add new outermost nesting, pushing the current outermost to the list, also taking care to swap patterns if necessary.
pushInnerKernelNesting :: Target -> LoopNesting -> KernelNest -> KernelNest Source #
Add new innermost nesting, pushing the current outermost to the
list. It is important that the Target
has the right order
(non-permuted compared to what is expected by the outer nests).
scopeOfKernelNest :: LParamInfo rep ~ Type => KernelNest -> Scope rep Source #
kernelNestLoops :: KernelNest -> [LoopNesting] Source #
kernelNestWidths :: KernelNest -> [SubExp] Source #
boundInKernelNest :: KernelNest -> Names Source #
boundInKernelNests :: KernelNest -> [Names] Source #
flatKernel :: MonadFreshNames m => KernelNest -> m ([(VName, SubExp)], [KernelInput]) Source #
Flatten a kernel nesting to:
- The index space.
- The kernel inputs - note that some of these may be unused.
constructKernel :: (DistRep rep, MonadFreshNames m, LocalScope rep m) => MkSegLevel rep m -> KernelNest -> Body rep -> m (Stm rep, Stms rep) Source #
tryDistribute :: (DistRep rep, MonadFreshNames m, LocalScope rep m, MonadLogger m) => MkSegLevel rep m -> Nestings -> Targets -> Stms rep -> m (Maybe (Targets, Stms rep)) Source #
tryDistributeStm :: (MonadFreshNames m, HasScope t m, ASTRep rep) => Nestings -> Targets -> Stm rep -> m (Maybe (Result, Targets, KernelNest)) Source #