futhark-0.25.19: An optimising compiler for a functional, array-oriented language.
Safe HaskellSafe-Inferred
LanguageGHC2021

Futhark.Optimise.GenRedOpt

Description

Tries to turn a generalized reduction kernel into a more specialized construct, for example: (a) a map nest with a sequential redomap ripe for tiling (b) a SegRed kernel followed by a smallish accumulation kernel. (c) a histogram (for this we need to track the withAccs) The idea is to identify the first accumulation and to separate the initial kernels into two: 1. the code up to and including the accumulation, which is optimized to turn the accumulation either into a map-reduce composition or a histogram, and 2. the remaining code, which is recursively optimized. Since this is mostly prototyping, when the accumulation can be rewritten as a map-reduce, we sequentialize the map-reduce, as to potentially enable tiling oportunities.

Synopsis

Documentation

optimiseGenRed :: Pass GPU GPU Source #

The pass definition.