[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 29 00:13:39 PST 2024


================
@@ -137,6 +137,11 @@ Removed Compiler Flags
 
 Attribute Changes in Clang
 --------------------------
+- Introduced a new function attribute ``__attribute__((amdgpu_max_num_work_groups(x, y, z)))`` or
+  ``[[clang::amdgpu_max_num_work_groups(x, y, z)]]`` for the AMDGPU target. This attribute can be
+  attached to HIP or OpenCL kernel function definitions to provide an optimization hint. The parameters
+  ``x``, ``y``, and ``z`` specify the maximum number of workgroups for the respective dimensions,
+  and each must be a positive integer.
----------------
arsenm wrote:

Should probably permit only specifying x, which leaves y and z assumed 1 

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


More information about the cfe-commits mailing list