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

Safe Haskell | None
Language | GHC2021

Futhark.IR.GPU.Simplify

Contents

- Building blocks
- Orphan instances

Synopsis

- simplifyGPU :: Prog GPU -> PassM (Prog GPU)
- simplifyLambda :: (HasScope GPU m, MonadFreshNames m) => Lambda GPU -> m (Lambda GPU)
- data GPU
- simplifyKernelOp :: (SimplifiableRep rep, BodyDec rep ~ ()) => SimplifyOp rep (op (Wise rep)) -> HostOp op (Wise rep) -> SimpleM rep (HostOp op (Wise rep), Stms (Wise rep))

# Documentation

simplifyGPU :: Prog GPU -> PassM (Prog GPU) Source #

simplifyLambda :: (HasScope GPU m, MonadFreshNames m) => Lambda GPU -> m (Lambda GPU) Source #

data GPU Source #

The phantom data type for the kernels representation.

#### Instances

Instances details

Analyse GPU Source # |
Instance details Defined in Futhark.Analysis.AccessPattern Methods analyseOp :: Op GPU -> Context GPU -> [VName] -> (Context GPU, IndexTable GPU)
PrimExpAnalysis GPU Source # |
Instance details Defined in Futhark.Analysis.PrimExp.Table Methods opPrimExp :: Scope GPU -> Op GPU -> State PrimExpTable () Source #
BuilderOps GPU Source # |
Instance details Defined in Futhark.IR.GPU Methods mkExpDecB :: (MonadBuilder m, Rep m ~ GPU) => Pat (LetDec GPU) -> Exp GPU -> m (ExpDec GPU) Source # mkBodyB :: (MonadBuilder m, Rep m ~ GPU) => Stms GPU -> Result -> m (Body GPU) Source # mkLetNamesB :: (MonadBuilder m, Rep m ~ GPU) => [VName] -> Exp GPU -> m (Stm GPU) Source #
Buildable GPU Source # |
Instance details Defined in Futhark.IR.GPU Methods mkExpPat :: [Ident] -> Exp GPU -> Pat (LetDec GPU) Source # mkExpDec :: Pat (LetDec GPU) -> Exp GPU -> ExpDec GPU Source # mkBody :: Stms GPU -> Result -> Body GPU Source # mkLetNames :: (MonadFreshNames m, HasScope GPU m) => [VName] -> Exp GPU -> m (Stm GPU) Source #
PrettyRep GPU Source # |
Instance details Defined in Futhark.IR.GPU Methods ppExpDec :: ExpDec GPU -> Exp GPU -> Maybe (Doc a) Source #
ASTRep GPU Source # |
Instance details Defined in Futhark.IR.GPU Methods expTypesFromPat :: (HasScope GPU m, Monad m) => Pat (LetDec GPU) -> m [BranchType GPU] Source #
RepTypes GPU Source # |

Instance details

Defined in Futhark.IR.GPU

Associated Types

type LetDec GPU |
Instance details Defined in Futhark.IR.GPU type LetDec GPU = Type
type ExpDec GPU |
Instance details Defined in Futhark.IR.GPU type ExpDec GPU = ()
type BodyDec GPU |
Instance details Defined in Futhark.IR.GPU type BodyDec GPU = ()
type FParamInfo GPU |
Instance details Defined in Futhark.IR.GPU type FParamInfo GPU = DeclType
type LParamInfo GPU |
Instance details Defined in Futhark.IR.GPU type LParamInfo GPU = Type
type RetType GPU |
Instance details Defined in Futhark.IR.GPU type RetType GPU = DeclExtType
type BranchType GPU |
Instance details Defined in Futhark.IR.GPU type BranchType GPU = ExtType
type OpC GPU |
Instance details Defined in Futhark.IR.GPU type OpC GPU = HostOp SOAC

HasSegOp GPU Source # |

Instance details

Defined in Futhark.IR.GPU

Associated Types

type SegOpLevel GPU |
Instance details Defined in Futhark.IR.GPU type SegOpLevel GPU = SegLevel

Methods

asSegOp :: Op GPU -> Maybe (SegOp (SegOpLevel GPU) GPU) Source #

segOp :: SegOp (SegOpLevel GPU) GPU -> Op GPU Source #

Checkable GPU Source # |

Instance details

Defined in Futhark.IR.GPU

Methods

checkExpDec :: ExpDec GPU -> TypeM GPU () Source #

checkBodyDec :: BodyDec GPU -> TypeM GPU () Source #

checkFParamDec :: VName -> FParamInfo GPU -> TypeM GPU () Source #

checkLParamDec :: VName -> LParamInfo GPU -> TypeM GPU () Source #

checkLetBoundDec :: VName -> LetDec GPU -> TypeM GPU () Source #

checkRetType :: [RetType GPU] -> TypeM GPU () Source #

matchPat :: Pat (LetDec (Aliases GPU)) -> Exp (Aliases GPU) -> TypeM GPU () Source #

primFParam :: VName -> PrimType -> TypeM GPU (FParam (Aliases GPU)) Source #

matchReturnType :: [RetType GPU] -> Result -> TypeM GPU () Source #

matchBranchType :: [BranchType GPU] -> Body (Aliases GPU) -> TypeM GPU () Source #

matchLoopResult :: [FParam (Aliases GPU)] -> Result -> TypeM GPU () Source #

checkOp :: Op (Aliases GPU) -> TypeM GPU () Source #

Transform GPU Source # |
Instance details Defined in Futhark.Optimise.ArrayLayout.Transform Methods onOp :: Monad m => SOACMapper GPU GPU m -> Op GPU -> m (Op GPU) transformOp :: LayoutTable -> ExpMap GPU -> Stm GPU -> Op GPU -> TransformM GPU (LayoutTable, ExpMap GPU)
Layout GPU Source # |
Instance details Defined in Futhark.Optimise.ArrayLayout.Layout Methods permutationFromDimAccess :: PrimExpTable -> SegOpName -> ArrayName -> IndexExprName -> [DimAccess GPU] -> Maybe Permutation
BuilderOps (Wise GPU) Source # |

Instance details

Defined in Futhark.IR.GPU.Simplify

Methods

mkExpDecB :: (MonadBuilder m, Rep m ~ Wise GPU) => Pat (LetDec (Wise GPU)) -> Exp (Wise GPU) -> m (ExpDec (Wise GPU)) Source #

mkBodyB :: (MonadBuilder m, Rep m ~ Wise GPU) => Stms (Wise GPU) -> Result -> m (Body (Wise GPU)) Source #

mkLetNamesB :: (MonadBuilder m, Rep m ~ Wise GPU) => [VName] -> Exp (Wise GPU) -> m (Stm (Wise GPU)) Source #

HasSOAC (Wise GPU) Source # |
Instance details Defined in Futhark.IR.GPU.Simplify Methods asSOAC :: Op (Wise GPU) -> Maybe (SOAC (Wise GPU)) Source # soacOp :: SOAC (Wise GPU) -> Op (Wise GPU) Source #
HasSegOp (Wise GPU) Source # |

Instance details

Defined in Futhark.IR.GPU.Simplify

Associated Types

type SegOpLevel (Wise GPU) |
Instance details Defined in Futhark.IR.GPU.Simplify type SegOpLevel (Wise GPU) = SegLevel

Methods

asSegOp :: Op (Wise GPU) -> Maybe (SegOp (SegOpLevel (Wise GPU)) (Wise GPU)) Source #

segOp :: SegOp (SegOpLevel (Wise GPU)) (Wise GPU) -> Op (Wise GPU) Source #

TraverseOpStms (Wise GPU) Source # |
Instance details Defined in Futhark.IR.GPU.Simplify Methods traverseOpStms :: Monad m => OpStmsTraverser m (Op (Wise GPU)) (Wise GPU) Source #
type BodyDec GPU Source # |
Instance details Defined in Futhark.IR.GPU type BodyDec GPU = ()
type BranchType GPU Source # |
Instance details Defined in Futhark.IR.GPU type BranchType GPU = ExtType
type ExpDec GPU Source # |
Instance details Defined in Futhark.IR.GPU type ExpDec GPU = ()
type FParamInfo GPU Source # |
Instance details Defined in Futhark.IR.GPU type FParamInfo GPU = DeclType
type LParamInfo GPU Source # |
Instance details Defined in Futhark.IR.GPU type LParamInfo GPU = Type
type LetDec GPU Source # |
Instance details Defined in Futhark.IR.GPU type LetDec GPU = Type
type OpC GPU Source # |
Instance details Defined in Futhark.IR.GPU type OpC GPU = HostOp SOAC
type RetType GPU Source # |
Instance details Defined in Futhark.IR.GPU type RetType GPU = DeclExtType
type SegOpLevel GPU Source # |
Instance details Defined in Futhark.IR.GPU type SegOpLevel GPU = SegLevel
type SegOpLevel (Wise GPU) Source # |
Instance details Defined in Futhark.IR.GPU.Simplify type SegOpLevel (Wise GPU) = SegLevel

# Building blocks

simplifyKernelOp :: (SimplifiableRep rep, BodyDec rep ~ ()) => SimplifyOp rep (op (Wise rep)) -> HostOp op (Wise rep) -> SimpleM rep (HostOp op (Wise rep), Stms (Wise rep)) Source #

# Orphan instances

BuilderOps (Wise GPU) Source # |
Instance details Methods mkExpDecB :: (MonadBuilder m, Rep m ~ Wise GPU) => Pat (LetDec (Wise GPU)) -> Exp (Wise GPU) -> m (ExpDec (Wise GPU)) Source # mkBodyB :: (MonadBuilder m, Rep m ~ Wise GPU) => Stms (Wise GPU) -> Result -> m (Body (Wise GPU)) Source # mkLetNamesB :: (MonadBuilder m, Rep m ~ Wise GPU) => [VName] -> Exp (Wise GPU) -> m (Stm (Wise GPU)) Source #
HasSOAC (Wise GPU) Source # |
Instance details Methods asSOAC :: Op (Wise GPU) -> Maybe (SOAC (Wise GPU)) Source # soacOp :: SOAC (Wise GPU) -> Op (Wise GPU) Source #
HasSegOp (Wise GPU) Source # |

Instance details

Associated Types

type SegOpLevel (Wise GPU) |
Instance details Defined in Futhark.IR.GPU.Simplify type SegOpLevel (Wise GPU) = SegLevel

Methods

asSegOp :: Op (Wise GPU) -> Maybe (SegOp (SegOpLevel (Wise GPU)) (Wise GPU)) Source #

segOp :: SegOp (SegOpLevel (Wise GPU)) (Wise GPU) -> Op (Wise GPU) Source #

TraverseOpStms (Wise GPU) Source # |
Instance details Methods traverseOpStms :: Monad m => OpStmsTraverser m (Op (Wise GPU)) (Wise GPU) Source #