| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Futhark.Pass.Flatten.Monad
Description
General definitions for the flattening transformation.
Defines not just the core monads that are involved, but also the various representations, except perhaps the ones that are completely local to another module.
Synopsis
- data IrregularKind
- = Dense
- | Replicated
- data IrregularRep = IrregularRep {}
- data ResRep
- newtype DistEnv = DistEnv {}
- data FlattenOps = FlattenOps {
- flattenSegLevel :: SegLevel
- flattenIrregularity :: DistIrregularity
- flattenFunHasParallelism :: FunHasParallelism
- flattenDistStmWith :: FlattenOps -> Segments -> DistEnv -> DistStm -> FlattenM DistEnv
- flattenScalarStmAt :: SegLevel -> Segments -> DistEnv -> DistInputs -> [DistResult] -> Stm SOACS -> FlattenM DistEnv
- flattenTopLevelStm :: Stm SOACS -> FlattenM ()
- data FlattenM a
- data FlattenState = FlattenState {}
- runFlattenM :: MonadFreshNames m => Scope GPU -> FlattenM a -> m (a, Set DemandFn)
- data BuiltinFn
- data LiftMode
- data DemandFn
- demandLifted :: Name -> LiftMode -> FlattenM ()
- demandBuiltin :: BuiltinFn -> FlattenM ()
- insertRepM :: ResTag -> ResRep -> DistEnv -> FlattenM DistEnv
- insertRepsM :: [(ResTag, ResRep)] -> DistEnv -> FlattenM DistEnv
- insertIrregularM :: VName -> VName -> VName -> ResTag -> VName -> IrregularKind -> DistEnv -> FlattenM DistEnv
- insertRegulars :: [ResTag] -> [VName] -> DistEnv -> DistEnv
- resVar :: ResTag -> DistEnv -> ResRep
- inputReps :: DistInputs -> DistEnv -> Map VName (Type, ResRep)
- segsAndElems :: DistEnv -> [DistInput] -> (Maybe (VName, VName, VName), [VName])
Documentation
data IrregularKind Source #
Constructors
| Dense | |
| Replicated |
Instances
| Show IrregularKind Source # | |
Defined in Futhark.Pass.Flatten.Monad Methods showsPrec :: Int -> IrregularKind -> ShowS # show :: IrregularKind -> String # showList :: [IrregularKind] -> ShowS # | |
| Eq IrregularKind Source # | |
Defined in Futhark.Pass.Flatten.Monad Methods (==) :: IrregularKind -> IrregularKind -> Bool # (/=) :: IrregularKind -> IrregularKind -> Bool # | |
data IrregularRep Source #
Constructors
| IrregularRep | |
Fields
| |
Instances
| Show IrregularRep Source # | |
Defined in Futhark.Pass.Flatten.Monad Methods showsPrec :: Int -> IrregularRep -> ShowS # show :: IrregularRep -> String # showList :: [IrregularRep] -> ShowS # | |
Constructors
| Regular VName | This variable is represented completely straightforwardly- if it is an array, it is a regular array. |
| Irregular IrregularRep | The representation of an irregular array. |
data FlattenOps Source #
Functions for tying together disparate modules - this is to avoid mutually recursive modules.
Constructors
| FlattenOps | |
Fields
| |
Flattening monad
Instances
data FlattenState Source #
Constructors
| FlattenState | |
Fields | |
Instances
| MonadState FlattenState FlattenM Source # | |
Defined in Futhark.Pass.Flatten.Monad Methods get :: FlattenM FlattenState # put :: FlattenState -> FlattenM () # state :: (FlattenState -> (a, FlattenState)) -> FlattenM a # | |
| MonadFreshNames (State FlattenState) Source # | |
Defined in Futhark.Pass.Flatten.Monad Methods getNameSource :: State FlattenState VNameSource Source # putNameSource :: VNameSource -> State FlattenState () Source # | |
runFlattenM :: MonadFreshNames m => Scope GPU -> FlattenM a -> m (a, Set DemandFn) Source #
Do not nest these - the counter for thresholds will be wrong.
Demands
A representation of the different kinds of builtin functions we can generate. This is used to only generate the ones we actually need for a given program.
Constructors
| BuiltinSegIota | |
| BuiltinRepIota | |
| BuiltinPrefixSum | |
| BuiltinPartition |
Instances
| Show BuiltinFn Source # | |
| Eq BuiltinFn Source # | |
| Ord BuiltinFn Source # | |
Constructors
| UniformLift | |
| NonUniformLift |
Indicate the need for a function to be generated. Instead of immediately generating them ourselves, we collect requirements from multiple flattening operations and satisfy them in their entirety.
Constructors
| DemandLifted Name LiftMode | We need this function to be lifted. |
| DemandBuiltin BuiltinFn |
demandLifted :: Name -> LiftMode -> FlattenM () Source #
Indicate that we rather need a lifted version of this function.
demandBuiltin :: BuiltinFn -> FlattenM () Source #
Demand the presence of this builtin function.
Insertions
insertIrregularM :: VName -> VName -> VName -> ResTag -> VName -> IrregularKind -> DistEnv -> FlattenM DistEnv Source #