futhark-0.18.3: An optimising compiler for a functional, array-oriented language.
Safe HaskellNone
LanguageHaskell2010

Futhark.Pass.ExtractKernels.Distribution

Synopsis

Documentation

data Targets Source #

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.

data Nesting Source #

Instances

Instances details
Show Nesting Source # 
Instance details

Defined in Futhark.Pass.ExtractKernels.Distribution

type KernelNest = (LoopNesting, [LoopNesting]) Source #

Note: first element is *outermost* nesting. This is different from the similar types elsewhere!

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).

flatKernel :: MonadFreshNames m => KernelNest -> m ([(VName, SubExp)], [KernelInput]) Source #

Flatten a kernel nesting to:

  1. The index space.
  2. 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 #