Skip to content

[mlir] Add description to amdgpu.dpp and rocdl.update.dpp #116598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,18 @@ def AMDGPU_DPPOp : AMDGPU_Op<"dpp", [SameTypeOperands, AllTypesMatch<["result",
DefaultValuedAttr<BoolAttr, "false">:$bound_ctrl)> {
let summary = "AMDGPU DPP operation";
let description = [{
This operation represents DPP functionality in a GPU program.
DPP provides the following operations:
This operation represents DPP (Data-Parallel Primitives) functionality in a GPU program.

It will result in the values from `src`, permuted according to
the DPP attributes(`kind`, `permArgument`, `row_mask`, `bank_mask` and `bound_ctrl`).

If a lane is masked off(by EXEC mask, `row_mask`, `bank_mask`, etc) or
has no value to receive(for example, if the source of a lane is out of range),
this operation will instead produce the value of `old`.

For detail explanation of the attributes, please check the ISA Reference Guide.

DPP provides the following operations:
- Full crossbar in a group of four (`quad_perm`)
- Wavefront shift left by one lane (`wave_shl`)
- Wavefront shift right by one lane (`wave_shr`)
Expand Down
15 changes: 15 additions & 0 deletions mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,21 @@ def ROCDL_DPPUpdateOp : ROCDL_IntrOp<"update.dpp", [], [0],
Arguments<(ins LLVM_Type:$old, LLVM_Type:$src, I32Attr:$dppCtrl, I32Attr:$rowMask,
I32Attr:$bankMask, I1Attr:$boundCtrl)> {
let results = (outs LLVM_Type:$res);
let summary = "Exchange data among lanes in a warp";
let description = [{
This operation maps to the DPP (Data-Parallel Primitives) intrinsics,
which allows lanes in the same warp to exchange data in their registers
directly following some very specific patterns.

It will result in the values from `src`, permuted according to
the DPP attributes(`dppCtrl`, `rowMask`, `bankMask` and `boundCtrl`).

If a lane is masked off(by EXEC mask, `rowMask`, `bankMask`, etc) or
has no value to receive(for example, if the source of a lane is out of range),
this operation will instead produce the value of `old`.

For detail explanation of the attributes, please check the ISA Reference Guide.
}];
let assemblyFormat = [{
attr-dict $old `,` $src `with` $dppCtrl `,` $rowMask `,` $bankMask `,` $boundCtrl `:` type($src)
}];
Expand Down
Loading