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

Safe HaskellNone
LanguageHaskell2010

Futhark.Pass.ExtractKernels.BlockedKernel

Synopsis

Documentation

blockedGenReduce Source #

Arguments

:: (MonadFreshNames m, HasScope Kernels m) 
=> SubExp 
-> [(VName, SubExp)]

Segment indexes and sizes.

-> [KernelInput] 
-> [GenReduceOp InKernel] 
-> Lambda InKernel 
-> [VName] 
-> m ([VName], Stms Kernels) 

blockedScan :: (MonadBinder m, Lore m ~ Kernels) => Pattern Kernels -> SubExp -> Scan InKernel -> Reduce InKernel -> Lambda InKernel -> SubExp -> [(VName, SubExp)] -> [KernelInput] -> [VName] -> m [VName] Source #

The VNames returned are the names of variables bound to the carry-out of the last thread. You can ignore them if you don't need them.

kerneliseLambda :: MonadFreshNames m => [SubExp] -> Lambda InKernel -> m (Lambda InKernel) Source #

Given a chunked fold lambda that takes its initial accumulator value as parameters, bind those parameters to the neutral element instead.

chunkLambda :: (MonadFreshNames m, HasScope Kernels m) => Pattern Kernels -> [SubExp] -> Lambda InKernel -> m (Lambda InKernel) Source #

Requires a fold lambda that includes accumulator parameters.

getSize :: (MonadBinder m, Op (Lore m) ~ Kernel innerlore) => String -> SizeClass -> m SubExp Source #