Skip to content

[mlir][amdgpu][docs] Add op examples to dialect docsΒ #146760

Open
@kuhar

Description

@kuhar

The amdgpu dialect docs contain op description and auto-generated syntax but not actual examples. We should improve dialect documentation by adding an example(s) for each op.

Other dialects like arith or SPIR-V can be referenced for inspiration on how to provide examples, e.g.:

Example:

// Scalar addition.
%a = arith.addi %b, %c : i64

// Scalar addition with overflow flags.
%a = arith.addi %b, %c overflow<nsw, nuw> : i64

// SIMD vector element-wise addition.
%f = arith.addi %g, %h : vector<4xi32>

// Tensor element-wise addition.
%x = arith.addi %y, %z : tensor<4x?xi8>

We should be able to extract examples by looking at op tests in https://github.com/llvm/llvm-project/blob/main/mlir/test/Dialect/AMDGPU/ops.mlir

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions