| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Futhark.IR.GPU
Contents
Description
A representation with flat parallelism via GPU-oriented kernels.
Synopsis
- data GPU
- module Futhark.IR.Prop
- module Futhark.IR.Traversals
- module Futhark.IR.Pretty
- module Futhark.IR.Syntax
- module Futhark.IR.GPU.Op
- module Futhark.IR.GPU.Sizes
- data SOAC rep
- data Scan rep = Scan {
- scanLambda :: Lambda rep
- scanNeutral :: [SubExp]
- data Reduce rep = Reduce {
- redComm :: Commutativity
- redLambda :: Lambda rep
- redNeutral :: [SubExp]
- data ScremaForm rep = ScremaForm {
- scremaLambda :: Lambda rep
- scremaScans :: [Scan rep]
- scremaReduces :: [Reduce rep]
- scremaType :: SubExp -> ScremaForm rep -> [Type]
- scanResults :: [Scan rep] -> Int
- singleScan :: Buildable rep => [Scan rep] -> Scan rep
- redResults :: [Reduce rep] -> Int
- singleReduce :: Buildable rep => [Reduce rep] -> Reduce rep
- soacType :: Typed (LParamInfo rep) => SOAC rep -> [Type]
- typeCheckSOAC :: Checkable rep => SOAC (Aliases rep) -> TypeM rep ()
- mkIdentityLambda :: (Buildable rep, MonadFreshNames m) => [Type] -> m (Lambda rep)
- isIdentityLambda :: Lambda rep -> Bool
- nilFn :: Buildable rep => Lambda rep
- scanomapSOAC :: [Scan rep] -> Lambda rep -> ScremaForm rep
- redomapSOAC :: [Reduce rep] -> Lambda rep -> ScremaForm rep
- scanSOAC :: (Buildable rep, MonadFreshNames m) => [Scan rep] -> m (ScremaForm rep)
- reduceSOAC :: (Buildable rep, MonadFreshNames m) => [Reduce rep] -> m (ScremaForm rep)
- mapSOAC :: Lambda rep -> ScremaForm rep
- isScanomapSOAC :: ScremaForm rep -> Maybe ([Scan rep], Lambda rep)
- isRedomapSOAC :: ScremaForm rep -> Maybe ([Reduce rep], Lambda rep)
- isScanSOAC :: ScremaForm rep -> Maybe [Scan rep]
- isReduceSOAC :: ScremaForm rep -> Maybe [Reduce rep]
- isMapSOAC :: ScremaForm rep -> Maybe (Lambda rep)
- ppScrema :: (PrettyRep rep, Pretty inp) => SubExp -> [inp] -> ScremaForm rep -> Doc ann
- ppHist :: (PrettyRep rep, Pretty inp) => SubExp -> [inp] -> [HistOp rep] -> Lambda rep -> Doc ann
- ppStream :: (PrettyRep rep, Pretty inp) => SubExp -> [inp] -> [SubExp] -> Lambda rep -> Doc ann
- data SOACMapper frep trep (m :: Type -> Type) = SOACMapper {
- mapOnSOACSubExp :: SubExp -> m SubExp
- mapOnSOACLambda :: Lambda frep -> m (Lambda trep)
- mapOnSOACVName :: VName -> m VName
- identitySOACMapper :: forall rep (m :: Type -> Type). Monad m => SOACMapper rep rep m
- mapSOACM :: Monad m => SOACMapper frep trep m -> SOAC frep -> m (SOAC trep)
- traverseSOACStms :: Monad m => OpStmsTraverser m (SOAC rep) rep
Documentation
The phantom data type for the kernels representation.
Instances
Module re-exports
module Futhark.IR.Prop
module Futhark.IR.Traversals
module Futhark.IR.Pretty
module Futhark.IR.Syntax
module Futhark.IR.GPU.Op
module Futhark.IR.GPU.Sizes
A second-order array combinator (SOAC).
Constructors
| Stream SubExp [VName] [SubExp] (Lambda rep) | |
| Hist SubExp [VName] [HistOp rep] (Lambda rep) | Hist length arrays dest-arrays-and-ops fun The final lambda produces indexes and values for the |
| JVP [SubExp] [SubExp] (Lambda rep) | |
| VJP [SubExp] [SubExp] (Lambda rep) | |
| Screma SubExp [VName] (ScremaForm rep) | A combination of scan, reduction, and map. The first
|
Instances
| CanBeAliased SOAC Source # | |
Defined in Futhark.IR.SOACS.SOAC Methods addOpAliases :: AliasableRep rep => AliasTable -> SOAC rep -> SOAC (Aliases rep) Source # | |
| IsOp SOAC Source # | |
| AliasedOp SOAC Source # | |
| TypedOp SOAC Source # | |
| RephraseOp SOAC Source # | |
Defined in Futhark.IR.SOACS.SOAC | |
| CanBeWise SOAC Source # | |
Defined in Futhark.IR.SOACS.SOAC | |
| RepTypes rep => Show (SOAC rep) Source # | |
| OpMetrics (Op rep) => OpMetrics (SOAC rep) Source # | |
| RepTypes rep => IndexOp (SOAC rep) Source # | |
| ASTRep rep => FreeIn (SOAC rep) Source # | |
| (AliasableRep rep, CSEInOp (Op (Aliases rep))) => CSEInOp (SOAC (Aliases rep)) Source # | |
| ASTRep rep => Rename (SOAC rep) Source # | |
| ASTRep rep => Substitute (SOAC rep) Source # | |
Defined in Futhark.IR.SOACS.SOAC | |
| RepTypes rep => Eq (SOAC rep) Source # | |
| RepTypes rep => Ord (SOAC rep) Source # | |
Defined in Futhark.IR.SOACS.SOAC | |
| PrettyRep rep => Pretty (SOAC rep) Source # | |
Defined in Futhark.IR.SOACS.SOAC | |
How to compute a single scan result.
Constructors
| Scan | |
Fields
| |
How to compute a single reduction result.
Constructors
| Reduce | |
Fields
| |
Instances
| RepTypes rep => Show (Reduce rep) Source # | |
| ASTRep rep => FreeIn (Reduce rep) Source # | |
| RepTypes rep => Eq (Reduce rep) Source # | |
| RepTypes rep => Ord (Reduce rep) Source # | |
Defined in Futhark.IR.SOACS.SOAC | |
| PrettyRep rep => Pretty (Reduce rep) Source # | |
Defined in Futhark.IR.SOACS.SOAC | |
data ScremaForm rep Source #
The essential parts of a Screma factored out (everything
except the input arrays).
Constructors
| ScremaForm | |
Fields
| |
Instances
| RepTypes rep => Show (ScremaForm rep) Source # | |
Defined in Futhark.IR.SOACS.SOAC Methods showsPrec :: Int -> ScremaForm rep -> ShowS # show :: ScremaForm rep -> String # showList :: [ScremaForm rep] -> ShowS # | |
| ASTRep rep => FreeIn (ScremaForm rep) Source # | |
Defined in Futhark.IR.SOACS.SOAC Methods freeIn' :: ScremaForm rep -> FV Source # | |
| RepTypes rep => Eq (ScremaForm rep) Source # | |
Defined in Futhark.IR.SOACS.SOAC Methods (==) :: ScremaForm rep -> ScremaForm rep -> Bool # (/=) :: ScremaForm rep -> ScremaForm rep -> Bool # | |
| RepTypes rep => Ord (ScremaForm rep) Source # | |
Defined in Futhark.IR.SOACS.SOAC Methods compare :: ScremaForm rep -> ScremaForm rep -> Ordering # (<) :: ScremaForm rep -> ScremaForm rep -> Bool # (<=) :: ScremaForm rep -> ScremaForm rep -> Bool # (>) :: ScremaForm rep -> ScremaForm rep -> Bool # (>=) :: ScremaForm rep -> ScremaForm rep -> Bool # max :: ScremaForm rep -> ScremaForm rep -> ScremaForm rep # min :: ScremaForm rep -> ScremaForm rep -> ScremaForm rep # | |
scremaType :: SubExp -> ScremaForm rep -> [Type] Source #
The types produced by a single Screma, given the size of the
input array.
singleScan :: Buildable rep => [Scan rep] -> Scan rep Source #
Combine multiple scan operators to a single operator.
singleReduce :: Buildable rep => [Reduce rep] -> Reduce rep Source #
Combine multiple reduction operators to a single operator.
mkIdentityLambda :: (Buildable rep, MonadFreshNames m) => [Type] -> m (Lambda rep) Source #
Construct a lambda that takes parameters of the given types and simply returns them unchanged.
isIdentityLambda :: Lambda rep -> Bool Source #
Is the given lambda an identity lambda?
scanomapSOAC :: [Scan rep] -> Lambda rep -> ScremaForm rep Source #
Construct a Screma with possibly multiple scans, and the given map function.
redomapSOAC :: [Reduce rep] -> Lambda rep -> ScremaForm rep Source #
Construct a Screma with possibly multiple reductions, and the given map function.
scanSOAC :: (Buildable rep, MonadFreshNames m) => [Scan rep] -> m (ScremaForm rep) Source #
Construct a Screma with possibly multiple scans, and identity map function.
reduceSOAC :: (Buildable rep, MonadFreshNames m) => [Reduce rep] -> m (ScremaForm rep) Source #
Construct a Screma with possibly multiple reductions, and identity map function.
mapSOAC :: Lambda rep -> ScremaForm rep Source #
Construct a Screma corresponding to a map.
isScanomapSOAC :: ScremaForm rep -> Maybe ([Scan rep], Lambda rep) Source #
Does this Screma correspond to a scan-map composition?
isRedomapSOAC :: ScremaForm rep -> Maybe ([Reduce rep], Lambda rep) Source #
Does this Screma correspond to a reduce-map composition?
isScanSOAC :: ScremaForm rep -> Maybe [Scan rep] Source #
Does this Screma correspond to pure scan?
isReduceSOAC :: ScremaForm rep -> Maybe [Reduce rep] Source #
Does this Screma correspond to a pure reduce?
isMapSOAC :: ScremaForm rep -> Maybe (Lambda rep) Source #
Does this Screma correspond to a simple map, without any reduction or scan results?
ppScrema :: (PrettyRep rep, Pretty inp) => SubExp -> [inp] -> ScremaForm rep -> Doc ann Source #
Prettyprint the given Screma.
ppHist :: (PrettyRep rep, Pretty inp) => SubExp -> [inp] -> [HistOp rep] -> Lambda rep -> Doc ann Source #
Prettyprint the given histogram operation.
ppStream :: (PrettyRep rep, Pretty inp) => SubExp -> [inp] -> [SubExp] -> Lambda rep -> Doc ann Source #
Prettyprint the given Stream.
data SOACMapper frep trep (m :: Type -> Type) Source #
Constructors
| SOACMapper | |
Fields
| |
identitySOACMapper :: forall rep (m :: Type -> Type). Monad m => SOACMapper rep rep m Source #
A mapper that simply returns the SOAC verbatim.
mapSOACM :: Monad m => SOACMapper frep trep m -> SOAC frep -> m (SOAC trep) Source #
Map a monadic action across the immediate children of a SOAC. The mapping does not descend recursively into subexpressions and is done left-to-right.
traverseSOACStms :: Monad m => OpStmsTraverser m (SOAC rep) rep Source #
A helper for defining TraverseOpStms.