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

Safe Haskell | None
Language | GHC2021

Futhark.Pass.ExtractKernels.BlockedKernel

Synopsis

- type DistRep rep = (Buildable rep, HasSegOp rep, BuilderOps rep, LetDec rep ~ Type, ExpDec rep ~ (), BodyDec rep ~ (), AliasableRep rep)
- type MkSegLevel rep (m :: Type -> Type) = [SubExp] -> String -> ThreadRecommendation -> BuilderT rep m (SegOpLevel rep)
- data ThreadRecommendation
  - = ManyThreads
  - | NoRecommendation SegVirt
- segRed :: (MonadFreshNames m, DistRep rep, HasScope rep m) => SegOpLevel rep -> Pat (LetDec rep) -> Certs -> SubExp -> [SegBinOp rep] -> Lambda rep -> [VName] -> [(VName, SubExp)] -> [KernelInput] -> m (Stms rep)
- nonSegRed :: (MonadFreshNames m, DistRep rep, HasScope rep m) => SegOpLevel rep -> Pat Type -> SubExp -> [SegBinOp rep] -> Lambda rep -> [VName] -> m (Stms rep)
- segScan :: (MonadFreshNames m, DistRep rep, HasScope rep m) => SegOpLevel rep -> Pat (LetDec rep) -> Certs -> SubExp -> [SegBinOp rep] -> Lambda rep -> [VName] -> [(VName, SubExp)] -> [KernelInput] -> m (Stms rep)
- segHist :: (DistRep rep, MonadFreshNames m, HasScope rep m) => SegOpLevel rep -> Pat Type -> SubExp -> [(VName, SubExp)] -> [KernelInput] -> [HistOp rep] -> Lambda rep -> [VName] -> m (Stms rep)
- segMap :: (MonadFreshNames m, DistRep rep, HasScope rep m) => SegOpLevel rep -> Pat (LetDec rep) -> SubExp -> Lambda rep -> [VName] -> [(VName, SubExp)] -> [KernelInput] -> m (Stms rep)
- mapKernel :: (DistRep rep, HasScope rep m, MonadFreshNames m) => MkSegLevel rep m -> [(VName, SubExp)] -> [KernelInput] -> [Type] -> KernelBody rep -> m (SegOp (SegOpLevel rep) rep, Stms rep)
- data KernelInput = KernelInput {
  - kernelInputName :: VName
  - kernelInputType :: Type
  - kernelInputArray :: VName
  - kernelInputIndices :: [SubExp]
  }
- readKernelInput :: (DistRep (Rep m), MonadBuilder m) => KernelInput -> m ()
- mkSegSpace :: MonadFreshNames m => [(VName, SubExp)] -> m SegSpace
- dummyDim :: MonadBuilder m => Pat Type -> m (Pat Type, [(VName, SubExp)], m ())

# Documentation

type DistRep rep = (Buildable rep, HasSegOp rep, BuilderOps rep, LetDec rep ~ Type, ExpDec rep ~ (), BodyDec rep ~ (), AliasableRep rep) Source #

Constraints pertinent to performing distribution/flattening.

type MkSegLevel rep (m :: Type -> Type) = [SubExp] -> String -> ThreadRecommendation -> BuilderT rep m (SegOpLevel rep) Source #

data ThreadRecommendation Source #

Constructors

ManyThreads |
NoRecommendation SegVirt |

segRed :: (MonadFreshNames m, DistRep rep, HasScope rep m) => SegOpLevel rep -> Pat (LetDec rep) -> Certs -> SubExp -> [SegBinOp rep] -> Lambda rep -> [VName] -> [(VName, SubExp)] -> [KernelInput] -> m (Stms rep) Source #

nonSegRed :: (MonadFreshNames m, DistRep rep, HasScope rep m) => SegOpLevel rep -> Pat Type -> SubExp -> [SegBinOp rep] -> Lambda rep -> [VName] -> m (Stms rep) Source #

segScan :: (MonadFreshNames m, DistRep rep, HasScope rep m) => SegOpLevel rep -> Pat (LetDec rep) -> Certs -> SubExp -> [SegBinOp rep] -> Lambda rep -> [VName] -> [(VName, SubExp)] -> [KernelInput] -> m (Stms rep) Source #

segHist Source #

Arguments

:: (DistRep rep, MonadFreshNames m, HasScope rep m) |
=> SegOpLevel rep |
-> Pat Type |
-> SubExp |
-> [(VName, SubExp)] | Segment indexes and sizes.
-> [KernelInput] |
-> [HistOp rep] |
-> Lambda rep |
-> [VName] |
-> m (Stms rep) |

segMap :: (MonadFreshNames m, DistRep rep, HasScope rep m) => SegOpLevel rep -> Pat (LetDec rep) -> SubExp -> Lambda rep -> [VName] -> [(VName, SubExp)] -> [KernelInput] -> m (Stms rep) Source #

mapKernel :: (DistRep rep, HasScope rep m, MonadFreshNames m) => MkSegLevel rep m -> [(VName, SubExp)] -> [KernelInput] -> [Type] -> KernelBody rep -> m (SegOp (SegOpLevel rep) rep, Stms rep) Source #

data KernelInput Source #

Constructors

KernelInput |

Fields

- kernelInputName :: VName
- kernelInputType :: Type
- kernelInputArray :: VName
- kernelInputIndices :: [SubExp]

#### Instances

Instances details

Show KernelInput Source # |
Instance details Defined in Futhark.Pass.ExtractKernels.BlockedKernel Methods showsPrec :: Int -> KernelInput -> ShowS Source # show :: KernelInput -> String Source # showList :: [KernelInput] -> ShowS Source #

readKernelInput :: (DistRep (Rep m), MonadBuilder m) => KernelInput -> m () Source #

mkSegSpace :: MonadFreshNames m => [(VName, SubExp)] -> m SegSpace Source #

dummyDim :: MonadBuilder m => Pat Type -> m (Pat Type, [(VName, SubExp)], m ()) Source #