[llvm] [Offload] Make olLaunchKernel test thread safe (PR #149497)
Ross Brunton via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 22 03:16:28 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:
I've had another look at this, and yes it makes sense for it to be guarded by AllocationsMutex rather than the device. Also, now I've slept on it a bit, I think it makes sense for the wrapper to handle this, so there's now a GetOrInit function that does this.
https://github.com/llvm/llvm-project/pull/149497
More information about the llvm-commits
mailing list