[llvm] [Offload] Make olLaunchKernel test thread safe (PR #149497)

Kevin Sala Penades via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 7 09:47:47 PDT 2025


================
@@ -2302,8 +2304,11 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
     // Once the stream is synchronized, return it to stream pool and reset
     // AsyncInfo. This is to make sure the synchronization only works for its
     // own tasks.
-    AsyncInfo.Queue = nullptr;
-    return AMDGPUStreamManager.returnResource(Stream);
+    if (RemoveQueue) {
----------------
kevinsala wrote:

As a note, the resource managers are not actually cheap in terms of concurrency. There is a lock in each resource manager (see `getResourcesImpl()`). If the managers become a bottleneck in the future, other implementations may could be explored (e.g., using atomics instead of mutex, have multiple resource managers, etc.)

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


More information about the llvm-commits mailing list