[clang] [llvm] [OpenMP] Add amdgpu-num-work-groups attribute to OpenMP kernels (PR #87695)

Shilei Tian via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 4 13:53:52 PDT 2024


================
@@ -4791,6 +4791,9 @@ void OpenMPIRBuilder::writeTeamsForKernel(const Triple &T, Function &Kernel,
       updateNVPTXMetadata(Kernel, "maxclusterrank", UB, true);
     updateNVPTXMetadata(Kernel, "minctasm", LB, false);
   }
+  if (T.isAMDGPU()) {
----------------
shiltian wrote:

```suggestion
  if (T.isAMDGPU())
    Kernel.addFnAttr("amdgpu-max-num-workgroups", llvm::utostr(LB) + ",1,1");
```

https://github.com/llvm/llvm-project/pull/87695


More information about the cfe-commits mailing list