This is an archive of the discontinued LLVM Phabricator instance.

[mlir][gpu] Introduce gpu.global_id op
ClosedPublic

Authored by Hardcode84 on Mar 13 2022, 4:03 AM.

Details

Summary

Introduce OpenCL-style global_id op and corresponding spirv lowering.

Diff Detail

Event Timeline

Hardcode84 created this revision.Mar 13 2022, 4:03 AM
Hardcode84 requested review of this revision.Mar 13 2022, 4:03 AM

fix op description

bondhugula added inline comments.Mar 13 2022, 6:32 AM
mlir/include/mlir/Dialect/GPU/GPUOps.td
117

There definitely has to be more description and explanation here -- at least on par with what you have above thread_id and block_id ops.

expand description

antiagainst accepted this revision.Mar 14 2022, 6:07 AM
antiagainst added inline comments.
mlir/include/mlir/Dialect/GPU/GPUOps.td
117

I'd suggest something like:

Returns the unique global workitem/thread id, i.e., the unique index of the current workitem/thread within all workgroups / grid along the x, y, or z `dimension`.
This revision is now accepted and ready to land.Mar 14 2022, 6:07 AM

rebase, update op description

This revision was automatically updated to reflect the committed changes.