Add SubgroupId, SubgroupSize and NumSubgroups to GPU dialect ops and add the lowering of those ops to SPIRV.
Details
Diff Detail
Event Timeline
mlir/include/mlir/Dialect/GPU/GPUOps.td | ||
---|---|---|
93 | I think we use "workgroup" in the documentation. We should actually be consistent in the op names as well | |
101 | let assemblyFormat = "attr-dict : type($result)" and changing the header to have Results<(outs Index:$result)> should give you custom syntax for almost free |
mlir/include/mlir/Dialect/GPU/GPUOps.td | ||
---|---|---|
93 | I can change it but all the Id Op above use block in comments and name (i.e. BlockDimOp, BlockIdOp) so it wold look inconsistent from this point of view. What do you think? |
mlir/include/mlir/Dialect/GPU/GPUOps.td | ||
---|---|---|
101 | Update the syntax. |
mlir/include/mlir/Dialect/GPU/GPUOps.td | ||
---|---|---|
93 | Other ops with inconsistent names are the reason why I suggested to change it in the documentation only. "Subgroup within the block" just sounds weird. Arguably, the op names should also be changed, but that would require an RFC and make sure @herhut and @mravishankar sign off on it. |
Cool, thanks Thomas! SPIR-V side looks good to me. :)
mlir/include/mlir/Dialect/GPU/GPUOps.td | ||
---|---|---|
114 | Nit: It seems the sgId needs to be properly named ? :) | |
130 | Here too. | |
mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.cpp | ||
73 | SingleDimLaunchConfigConversion? | |
mlir/test/Conversion/GPUToSPIRV/builtins.mlir | ||
185 | I don't think we need this function for this test? Removing it can simplify the test itself. Less code is typically better. :) Similarly for the rest. :) |
mlir/include/mlir/Dialect/GPU/GPUOps.td | ||
---|---|---|
93 | Thanks for explaining, changed it. |
I think we use "workgroup" in the documentation. We should actually be consistent in the op names as well