Safe Haskell | None |
---|---|
Language | Haskell2010 |
A representation of nested-parallel in-kernel per-workgroup expressions.
Synopsis
- data KernelExp lore
- = SplitSpace SplitOrdering SubExp SubExp SubExp
- | Combine CombineSpace [Type] [(VName, SubExp)] (Body lore)
- | GroupReduce SubExp (Lambda lore) [(SubExp, VName)]
- | GroupScan SubExp (Lambda lore) [(SubExp, VName)]
- | GroupStream SubExp SubExp (GroupStreamLambda lore) [SubExp] [VName]
- | GroupGenReduce [SubExp] [VName] (LambdaT lore) [SubExp] [SubExp] VName
- | Barrier [SubExp]
- data GroupStreamLambda lore = GroupStreamLambda {
- groupStreamChunkSize :: VName
- groupStreamChunkOffset :: VName
- groupStreamAccParams :: [LParam lore]
- groupStreamArrParams :: [LParam lore]
- groupStreamLambdaBody :: Body lore
- data SplitOrdering
- data CombineSpace = CombineSpace {
- cspaceScatter :: [(SubExp, Int, VName)]
- cspaceDims :: [(VName, SubExp)]
- combineSpace :: [(VName, SubExp)] -> CombineSpace
- scopeOfCombineSpace :: CombineSpace -> Scope lore
- typeCheckKernelExp :: Checkable lore => KernelExp (Aliases lore) -> TypeM lore ()
Documentation
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 |
Combine CombineSpace [Type] [(VName, SubExp)] (Body lore) |
The result of a combine is always stored in local memory (OpenCL terminology) The same thread may be assigned to multiple
elements of |
GroupReduce SubExp (Lambda lore) [(SubExp, VName)] |
The arrays Currently a GroupReduce consumes the input arrays, as it uses them for scratch space to store temporary results All threads in a group must participate in a GroupReduce (due to barriers) The length of the arrays |
GroupScan SubExp (Lambda lore) [(SubExp, VName)] | Same restrictions as with |
GroupStream SubExp SubExp (GroupStreamLambda lore) [SubExp] [VName] | |
GroupGenReduce [SubExp] [VName] (LambdaT lore) [SubExp] [SubExp] VName | |
Barrier [SubExp] | HACK: Semantically identity, but inserts a barrier afterwards. This reflects a weakness in our kernel representation. |
Instances
data GroupStreamLambda lore Source #
GroupStreamLambda | |
|
Instances
data SplitOrdering Source #
How an array is split into chunks.
Instances
data CombineSpace Source #
A combine can be fully or partially in-place. The initial arrays here work like the ones from the Scatter SOAC.
CombineSpace | |
|
Instances
combineSpace :: [(VName, SubExp)] -> CombineSpace Source #
scopeOfCombineSpace :: CombineSpace -> Scope lore Source #