futhark-0.9.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 (Stms Kernels, SubExp, [(VName, SubExp)], [KernelInput], [Type]) Source #

Flatten a kernel nesting to:

  1. Ancillary prologue bindings.
  2. The total number of threads, equal to the product of all nesting widths, and equal to the product of the index space.
  3. The index space.
  4. The kernel inputs - not that some of these may be unused.
  5. The per-thread return type.