[llvm] [Offload] Make olLaunchKernel test thread safe (PR #149497)
Ross Brunton via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 18 06:46:43 PDT 2025
================
@@ -2227,6 +2227,7 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
/// Get the stream of the asynchronous info structure or get a new one.
Error getStream(AsyncInfoWrapperTy &AsyncInfoWrapper,
AMDGPUStreamTy *&Stream) {
+ std::lock_guard<std::mutex> StreamLock{StreamMutex};
----------------
RossBrunton wrote:
Multiple threads can call `getStream`, see that the stream doesn't exist and create a new one. This can result in multiple streams being created in error.
https://github.com/llvm/llvm-project/pull/149497
More information about the llvm-commits
mailing list