Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data HistOp lore = HistOp {}
- histType :: HistOp lore -> [Type]
- data SegRedOp lore = SegRedOp {
- segRedComm :: Commutativity
- segRedLambda :: Lambda lore
- segRedNeutral :: [SubExp]
- segRedShape :: Shape
- segRedResults :: [SegRedOp lore] -> Int
- data KernelBody lore = KernelBody {
- kernelBodyLore :: BodyAttr lore
- kernelBodyStms :: Stms lore
- kernelBodyResult :: [KernelResult]
- aliasAnalyseKernelBody :: (Attributes lore, CanBeAliased (Op lore)) => KernelBody lore -> KernelBody (Aliases lore)
- consumedInKernelBody :: Aliased lore => KernelBody lore -> Names
- data ResultManifest
- data KernelResult
- = Returns ResultManifest SubExp
- | WriteReturns [SubExp] VName [([SubExp], SubExp)]
- | ConcatReturns SplitOrdering SubExp SubExp VName
- | TileReturns [(SubExp, SubExp)] VName
- kernelResultSubExp :: KernelResult -> SubExp
- data SplitOrdering
- data SegOp lore
- data SegLevel
- data SegVirt
- segLevel :: SegOp lore -> SegLevel
- segSpace :: SegOp lore -> SegSpace
- typeCheckSegOp :: Checkable lore => Maybe SegLevel -> SegOp (Aliases lore) -> TypeM lore ()
- data SegSpace = SegSpace {
- segFlat :: VName
- unSegSpace :: [(VName, SubExp)]
- scopeOfSegSpace :: SegSpace -> Scope lore
- segSpaceDims :: SegSpace -> [SubExp]
- data SegOpMapper flore tlore m = SegOpMapper {
- mapOnSegOpSubExp :: SubExp -> m SubExp
- mapOnSegOpLambda :: Lambda flore -> m (Lambda tlore)
- mapOnSegOpBody :: KernelBody flore -> m (KernelBody tlore)
- mapOnSegOpVName :: VName -> m VName
- identitySegOpMapper :: Monad m => SegOpMapper lore lore m
- mapSegOpM :: (Applicative m, Monad m) => SegOpMapper flore tlore m -> SegOp flore -> m (SegOp tlore)
- data SizeOp
- data HostOp lore op
- typeCheckHostOp :: Checkable lore => (SegLevel -> OpWithAliases (Op lore) -> TypeM lore ()) -> Maybe SegLevel -> (op -> TypeM lore ()) -> HostOp (Aliases lore) op -> TypeM lore ()
- module Futhark.Representation.Kernels.Sizes
Documentation
HistOp | |
|
Instances
Annotations lore => Eq (HistOp lore) Source # | |
Annotations lore => Ord (HistOp lore) Source # | |
Defined in Futhark.Representation.Kernels.Kernel | |
Annotations lore => Show (HistOp lore) Source # | |
histType :: HistOp lore -> [Type] Source #
The type of a histogram produced by a HistOp
. This can be
different from the type of the HistDest
s in case we are
dealing with a segmented histogram.
SegRedOp | |
|
Instances
Annotations lore => Eq (SegRedOp lore) Source # | |
Annotations lore => Ord (SegRedOp lore) Source # | |
Defined in Futhark.Representation.Kernels.Kernel compare :: SegRedOp lore -> SegRedOp lore -> Ordering # (<) :: SegRedOp lore -> SegRedOp lore -> Bool # (<=) :: SegRedOp lore -> SegRedOp lore -> Bool # (>) :: SegRedOp lore -> SegRedOp lore -> Bool # (>=) :: SegRedOp lore -> SegRedOp lore -> Bool # | |
Annotations lore => Show (SegRedOp lore) Source # | |
segRedResults :: [SegRedOp lore] -> Int Source #
How many reduction results are produced by these SegRedOp
s?
data KernelBody lore Source #
The body of a Kernel
.
KernelBody | |
|
Instances
aliasAnalyseKernelBody :: (Attributes lore, CanBeAliased (Op lore)) => KernelBody lore -> KernelBody (Aliases lore) Source #
consumedInKernelBody :: Aliased lore => KernelBody lore -> Names Source #
data ResultManifest Source #
Metadata about whether there is a subtle point to this
KernelResult
. This is used to protect things like tiling, which
might otherwise be removed by the simplifier because they're
semantically redundant. This has no semantic effect and can be
ignored at code generation.
ResultNoSimplify | Don't simplify this one! |
ResultMaySimplify | Go nuts. |
ResultPrivate | The results produced are only used within the same physical thread later on, and can thus be kept in registers. |
Instances
Eq ResultManifest Source # | |
Defined in Futhark.Representation.Kernels.Kernel (==) :: ResultManifest -> ResultManifest -> Bool # (/=) :: ResultManifest -> ResultManifest -> Bool # | |
Ord ResultManifest Source # | |
Defined in Futhark.Representation.Kernels.Kernel compare :: ResultManifest -> ResultManifest -> Ordering # (<) :: ResultManifest -> ResultManifest -> Bool # (<=) :: ResultManifest -> ResultManifest -> Bool # (>) :: ResultManifest -> ResultManifest -> Bool # (>=) :: ResultManifest -> ResultManifest -> Bool # max :: ResultManifest -> ResultManifest -> ResultManifest # min :: ResultManifest -> ResultManifest -> ResultManifest # | |
Show ResultManifest Source # | |
Defined in Futhark.Representation.Kernels.Kernel showsPrec :: Int -> ResultManifest -> ShowS # show :: ResultManifest -> String # showList :: [ResultManifest] -> ShowS # |
data KernelResult Source #
Returns ResultManifest SubExp | Each "worker" in the kernel returns this.
Whether this is a result-per-thread or a
result-per-group depends on the |
WriteReturns [SubExp] VName [([SubExp], SubExp)] | |
ConcatReturns SplitOrdering SubExp SubExp VName | |
TileReturns [(SubExp, SubExp)] VName |
Instances
data SplitOrdering Source #
How an array is split into chunks.
Instances
Segmented operations
SegMap SegLevel SegSpace [Type] (KernelBody lore) | |
SegRed SegLevel SegSpace [SegRedOp lore] [Type] (KernelBody lore) | The KernelSpace must always have at least two dimensions, implying that the result of a SegRed is always an array. |
SegScan SegLevel SegSpace (Lambda lore) [SubExp] [Type] (KernelBody lore) | |
SegHist SegLevel SegSpace [HistOp lore] [Type] (KernelBody lore) |
Instances
At which level the *body* of a SegOp
executes.
Do we need group-virtualisation when generating code for the
segmented operation? In most cases, we do, but for some simple
kernels, we compute the full number of groups in advance, and then
virtualisation is an unnecessary (but generally very small)
overhead. This only really matters for fairly trivial but very
wide map
kernels where each thread performs constant-time work on
scalars.
typeCheckSegOp :: Checkable lore => Maybe SegLevel -> SegOp (Aliases lore) -> TypeM lore () Source #
Index space of a SegOp
.
SegSpace | |
|
scopeOfSegSpace :: SegSpace -> Scope lore Source #
segSpaceDims :: SegSpace -> [SubExp] Source #
Generic traversal
data SegOpMapper flore tlore m Source #
SegOpMapper | |
|
identitySegOpMapper :: Monad m => SegOpMapper lore lore m Source #
A mapper that simply returns the SegOp
verbatim.
mapSegOpM :: (Applicative m, Monad m) => SegOpMapper flore tlore m -> SegOp flore -> m (SegOp tlore) Source #
Size operations
A simple size-level query or computation.
SplitSpace SplitOrdering SubExp SubExp SubExp |
Computes how to divide array elements to threads in a kernel. Returns the number of elements in the chunk that the current thread should take.
If the order If the order |
GetSize Name SizeClass | Produce some runtime-configurable size. |
GetSizeMax SizeClass | The maximum size of some class. |
CmpSizeLe Name SizeClass SubExp | Compare size (likely a threshold) with some integer value. |
CalcNumGroups SubExp Name SubExp |
|
Instances
Host operations
A host-level operation; parameterised by what else it can do.
Instances
typeCheckHostOp :: Checkable lore => (SegLevel -> OpWithAliases (Op lore) -> TypeM lore ()) -> Maybe SegLevel -> (op -> TypeM lore ()) -> HostOp (Aliases lore) op -> TypeM lore () Source #