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

Safe Haskell | Safe-Inferred
Language | GHC2021

Futhark.Optimise.TileLoops.Shared

Synopsis

- type TileM = ReaderT (Scope GPU) (State VNameSource)
- type Env = (WithEnv, IxFnEnv)
- index :: MonadBuilder m => String -> VName -> [VName] -> m VName
- update :: MonadBuilder m => String -> VName -> [VName] -> SubExp -> m VName
- forLoop' :: SubExp -> [VName] -> (VName -> [VName] -> Builder GPU (Body GPU)) -> Builder GPU [VName]
- forLoop :: SubExp -> [VName] -> (VName -> [VName] -> Builder GPU (Body GPU)) -> Builder GPU VName
- segMap1D :: String -> SegLevel -> ResultManifest -> SubExp -> (VName -> Builder GPU Result) -> Builder GPU [VName]
- segMap2D :: String -> SegLevel -> ResultManifest -> (SubExp, SubExp) -> ((VName, VName) -> Builder GPU Result) -> Builder GPU [VName]
- segMap3D :: String -> SegLevel -> ResultManifest -> (SubExp, SubExp, SubExp) -> ((VName, VName, VName) -> Builder GPU Result) -> Builder GPU [VName]
- segScatter2D :: String -> VName -> [SubExp] -> (SubExp, SubExp) -> ([VName] -> (VName, VName) -> Builder GPU (SubExp, SubExp)) -> Builder GPU VName
- type VarianceTable = Map VName Names
- varianceInStms :: VarianceTable -> Stms GPU -> VarianceTable
- isTileableRedomap :: Stm GPU -> Maybe (SubExp, [VName], (Commutativity, Lambda GPU, [SubExp], Lambda GPU))
- changeEnv :: Env -> VName -> Exp GPU -> TileM Env
- data TileKind
  - = TilePartial
  - | TileFull

# Documentation

type TileM = ReaderT (Scope GPU) (State VNameSource) Source #

type Env = (WithEnv, IxFnEnv) Source #

index :: MonadBuilder m => String -> VName -> [VName] -> m VName Source #

update :: MonadBuilder m => String -> VName -> [VName] -> SubExp -> m VName Source #

forLoop' :: SubExp -> [VName] -> (VName -> [VName] -> Builder GPU (Body GPU)) -> Builder GPU [VName] Source #

forLoop :: SubExp -> [VName] -> (VName -> [VName] -> Builder GPU (Body GPU)) -> Builder GPU VName Source #

segMap1D :: String -> SegLevel -> ResultManifest -> SubExp -> (VName -> Builder GPU Result) -> Builder GPU [VName] Source #

segMap2D :: String -> SegLevel -> ResultManifest -> (SubExp, SubExp) -> ((VName, VName) -> Builder GPU Result) -> Builder GPU [VName] Source #

segMap3D :: String -> SegLevel -> ResultManifest -> (SubExp, SubExp, SubExp) -> ((VName, VName, VName) -> Builder GPU Result) -> Builder GPU [VName] Source #

segScatter2D :: String -> VName -> [SubExp] -> (SubExp, SubExp) -> ([VName] -> (VName, VName) -> Builder GPU (SubExp, SubExp)) -> Builder GPU VName Source #

type VarianceTable = Map VName Names Source #

The variance table keeps a mapping from a variable name (something produced by a `Stm`) to the kernel thread indices that name depends on. If a variable is not present in this table, that means it is bound outside the kernel (and so can be considered invariant to all dimensions).

varianceInStms :: VarianceTable -> Stms GPU -> VarianceTable Source #

isTileableRedomap :: Stm GPU -> Maybe (SubExp, [VName], (Commutativity, Lambda GPU, [SubExp], Lambda GPU)) Source #

changeEnv :: Env -> VName -> Exp GPU -> TileM Env Source #

data TileKind Source #

Are we working with full or partial tiles?

Constructors

TilePartial |
TileFull |