This is an archive of the discontinued LLVM Phabricator instance.

[mlir][rocdl] Change the translation of `GridDim*Op` to `__ockl_get_num_groups`
ClosedPublic

Authored by fmorac on Jul 21 2023, 6:25 PM.

Details

Summary

Currently, ROCDL::GridDim*Op is being translated to __ockl_get_global_size, however
to match the meaning of gpu.grid_dim it should instead be translated to
__ockl_get_num_groups. This change would also make it agree with the meaning
of gridDimx.* in HIP, see:
https://github.com/ROCm-Developer-Tools/hipamd/blob/develop/include/hip/amd_detail/amd_hip_runtime.h#L257

Difference between the functions:

__ockl_get_global_size =  blockDim * numBlocks
__ockl_get_num_groups = numBlocks

Diff Detail

Event Timeline

fmorac created this revision.Jul 21 2023, 6:25 PM
Herald added a reviewer: dcaballe. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
fmorac edited the summary of this revision. (Show Details)Jul 21 2023, 6:27 PM
fmorac added a reviewer: krzysz00.
fmorac edited the summary of this revision. (Show Details)
fmorac published this revision for review.Jul 21 2023, 6:32 PM

Looks good to me, thanks for catching this!

krzysz00 accepted this revision.Jul 21 2023, 7:12 PM
This revision is now accepted and ready to land.Jul 21 2023, 7:12 PM