futhark-0.9.1: An optimising compiler for a functional, array-oriented language.

Safe HaskellNone
LanguageHaskell2010

Futhark.Pass.ExtractKernels.Intragroup

Description

Extract limited nested parallelism for execution inside individual kernel workgroups.

Synopsis

Documentation

intraGroupParallelise :: (MonadFreshNames m, LocalScope Kernels m) => KernelNest -> Lambda -> m (Maybe ((SubExp, SubExp), SubExp, Stms Kernels, Stms Kernels)) Source #

Convert the statements inside a map nest to kernel statements, attempting to parallelise any remaining (top-level) parallel statements. Anything that is not a map, scan or reduction will simply be sequentialised. This includes sequential loops that contain maps, scans or reduction. In the future, we could probably do something more clever. Make sure that the amount of parallelism to be exploited does not exceed the group size. Further, as a hack we also consider the size of all intermediate arrays as "parallelism to be exploited" to avoid exploding local memory.

We distinguish between "minimum group size" and "maximum exploitable parallelism".