Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Target = (PatternT 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 :: DistLore lore => Targets -> Scope lore
- data LoopNesting = MapNesting {}
- ppLoopNesting :: LoopNesting -> String
- scopeOfLoopNesting :: DistLore lore => LoopNesting -> Scope lore
- 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
- kernelNestLoops :: KernelNest -> [LoopNesting]
- kernelNestWidths :: KernelNest -> [SubExp]
- boundInKernelNest :: KernelNest -> Names
- boundInKernelNests :: KernelNest -> [Names]
- flatKernel :: MonadFreshNames m => KernelNest -> m ([(VName, SubExp)], [KernelInput])
- constructKernel :: (DistLore lore, MonadFreshNames m, LocalScope lore m) => MkSegLevel lore m -> KernelNest -> Body lore -> m (Stm lore, Stms lore)
- tryDistribute :: (DistLore lore, MonadFreshNames m, LocalScope lore m, MonadLogger m) => MkSegLevel lore m -> Nestings -> Targets -> Stms lore -> m (Maybe (Targets, Stms lore))
- tryDistributeStm :: (MonadFreshNames m, HasScope t m, ASTLore lore) => Nestings -> Targets -> Stm lore -> 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 :: DistLore lore => LoopNesting -> Scope lore 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).
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 :: (DistLore lore, MonadFreshNames m, LocalScope lore m) => MkSegLevel lore m -> KernelNest -> Body lore -> m (Stm lore, Stms lore) Source #
tryDistribute :: (DistLore lore, MonadFreshNames m, LocalScope lore m, MonadLogger m) => MkSegLevel lore m -> Nestings -> Targets -> Stms lore -> m (Maybe (Targets, Stms lore)) Source #
tryDistributeStm :: (MonadFreshNames m, HasScope t m, ASTLore lore) => Nestings -> Targets -> Stm lore -> m (Maybe (Result, Targets, KernelNest)) Source #