[llvm-branch-commits] [libclc] libclc: Fix amdgpu get_enqueued_local_size (PR #185171)

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Mar 7 02:36:42 PST 2026


https://github.com/arsenm updated https://github.com/llvm/llvm-project/pull/185171

>From a2c7b88d3adee8c1403329c13ab3e9718d168285 Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Sat, 7 Mar 2026 10:39:39 +0100
Subject: [PATCH] libclc: Fix amdgpu get_enqueued_local_size

This should not be the same as get_local_size
---
 .../clc/lib/amdgcn/workitem/clc_get_enqueued_local_size.cl | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libclc/clc/lib/amdgcn/workitem/clc_get_enqueued_local_size.cl b/libclc/clc/lib/amdgcn/workitem/clc_get_enqueued_local_size.cl
index c7226241694b3..102294e6dbb25 100644
--- a/libclc/clc/lib/amdgcn/workitem/clc_get_enqueued_local_size.cl
+++ b/libclc/clc/lib/amdgcn/workitem/clc_get_enqueued_local_size.cl
@@ -7,8 +7,11 @@
 //===----------------------------------------------------------------------===//
 
 #include "clc/workitem/clc_get_enqueued_local_size.h"
-#include "clc/workitem/clc_get_local_size.h"
+#include <amdhsa_abi.h>
 
 _CLC_OVERLOAD _CLC_DEF size_t __clc_get_enqueued_local_size(uint dim) {
-  return __clc_get_local_size(dim);
+  __constant amdhsa_implicit_kernarg_v5 *args =
+      (__constant amdhsa_implicit_kernarg_v5 *)
+          __builtin_amdgcn_implicitarg_ptr();
+  return dim < 3 ? args->group_size[dim] : 1;
 }



More information about the llvm-branch-commits mailing list