[mlir][rocdl] Change the translation of `GridDim*Op` to `__ockl_get_num_groups`
authorFabian Mora <fmora.dev@gmail.com>
Sat, 22 Jul 2023 11:32:42 +0000 (11:32 +0000)
committerFabian Mora <fmora.dev@gmail.com>
Sat, 22 Jul 2023 11:33:11 +0000 (11:33 +0000)
commit4538347fb2dafbf7ec175ffa96f802472aa707e9
treefbf948dafe67b302dc321ca26e2dd1f04f8f6dca
parentff380ced051975d45ded8c1386d8d602c615db61
[mlir][rocdl] Change the translation of `GridDim*Op` to `__ockl_get_num_groups`

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
```

Reviewed By: krzysz00

Differential Revision: https://reviews.llvm.org/D156009
mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
mlir/test/Target/LLVMIR/rocdl.mlir