futhark-0.12.1: 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.

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

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

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.

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.