Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Target = (Pattern Kernels, 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 :: Targets -> Scope Kernels
- data LoopNesting = MapNesting {}
- ppLoopNesting :: LoopNesting -> String
- 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
- pushKernelNesting :: Target -> LoopNesting -> KernelNest -> KernelNest
- pushInnerKernelNesting :: Target -> LoopNesting -> KernelNest -> KernelNest
- removeArraysFromNest :: [VName] -> KernelNest -> KernelNest
- kernelNestLoops :: KernelNest -> [LoopNesting]
- kernelNestWidths :: KernelNest -> [SubExp]
- boundInKernelNest :: KernelNest -> Names
- boundInKernelNests :: KernelNest -> [Names]
- flatKernel :: MonadFreshNames m => KernelNest -> m (Stms Kernels, SubExp, [(VName, SubExp)], [KernelInput], [Type])
- constructKernel :: (MonadFreshNames m, LocalScope Kernels m) => KernelNest -> KernelBody InKernel -> m (Stms Kernels, SubExp, Stm Kernels)
- tryDistribute :: (MonadFreshNames m, LocalScope Kernels m, MonadLogger m) => Nestings -> Targets -> Stms InKernel -> m (Maybe (Targets, Stms Kernels))
- tryDistributeStm :: (MonadFreshNames m, HasScope t m, Attributes 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 #
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 -> Names Source # | |
Scoped Kernels LoopNesting Source # | |
Defined in Futhark.Pass.ExtractKernels.Distribution |
ppLoopNesting :: LoopNesting -> String 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 #
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).
removeArraysFromNest :: [VName] -> KernelNest -> KernelNest Source #
Remove these arrays from the outermost nesting, and all uses of corresponding parameters from innermost nesting.
kernelNestLoops :: KernelNest -> [LoopNesting] Source #
kernelNestWidths :: KernelNest -> [SubExp] Source #
boundInKernelNest :: KernelNest -> Names Source #
boundInKernelNests :: KernelNest -> [Names] Source #
flatKernel :: MonadFreshNames m => KernelNest -> m (Stms Kernels, SubExp, [(VName, SubExp)], [KernelInput], [Type]) Source #
Flatten a kernel nesting to:
- Ancillary prologue bindings.
- The total number of threads, equal to the product of all nesting widths, and equal to the product of the index space.
- The index space.
- The kernel inputs - not that some of these may be unused.
- The per-thread return type.
constructKernel :: (MonadFreshNames m, LocalScope Kernels m) => KernelNest -> KernelBody InKernel -> m (Stms Kernels, SubExp, Stm Kernels) Source #
tryDistribute :: (MonadFreshNames m, LocalScope Kernels m, MonadLogger m) => Nestings -> Targets -> Stms InKernel -> m (Maybe (Targets, Stms Kernels)) Source #
tryDistributeStm :: (MonadFreshNames m, HasScope t m, Attributes lore) => Nestings -> Targets -> Stm lore -> m (Maybe (Result, Targets, KernelNest)) Source #