[llvm] [Offload] Return an integer user count for AMDGPU HSA queues (PR #223335)

via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 23 23:58:38 PDT 2026


https://github.com/StevenYangCC updated https://github.com/llvm/llvm-project/pull/223335

>From 63b4306336fa8d641e311268e590618255c16bdf Mon Sep 17 00:00:00 2001
From: "chengcang.yang" <yangchengcang at gmail.com>
Date: Thu, 24 Sep 2026 14:55:57 +0800
Subject: [PATCH] [Offload] Return uint32_t from AMDGPUQueueTy::getUserCount

NumUsers is a uint32_t, but getUserCount returned bool. Least-used queue
selection then treated every non-zero count as one. Return the integer
count so those queues can be distinguished.
---
 offload/plugins-nextgen/amdgpu/src/rtl.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/offload/plugins-nextgen/amdgpu/src/rtl.cpp b/offload/plugins-nextgen/amdgpu/src/rtl.cpp
index 92afb883840ef..8169231a5ceaa 100644
--- a/offload/plugins-nextgen/amdgpu/src/rtl.cpp
+++ b/offload/plugins-nextgen/amdgpu/src/rtl.cpp
@@ -814,7 +814,7 @@ struct AMDGPUQueueTy {
   }
 
   /// Returns the number of streams, this queue is currently assigned to.
-  bool getUserCount() const { return NumUsers; }
+  uint32_t getUserCount() const { return NumUsers; }
 
   /// Returns if the underlying HSA queue is initialized.
   bool isInitialized() { return Queue != nullptr; }



More information about the llvm-commits mailing list