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

Safe Haskell | None
Language | GHC2021

Futhark.Pass.ExtractKernels.Intrablock

Description

Extract limited nested parallelism for execution inside individual kernel threadblocks.

Synopsis

- intrablockParallelise :: (MonadFreshNames m, LocalScope GPU m) => KernelNest -> Lambda SOACS -> m (Maybe ((SubExp, SubExp), SubExp, Log, Stms GPU, Stms GPU))

# Documentation

intrablockParallelise :: (MonadFreshNames m, LocalScope GPU m) => KernelNest -> Lambda SOACS -> m (Maybe ((SubExp, SubExp), SubExp, Log, Stms GPU, Stms GPU)) 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 shared memory.

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