From e4f4426ced0ba3a441747f3f134bbd7d24606be7 Mon Sep 17 00:00:00 2001
From: foreman
Date: Wed, 17 Jul 2019 16:32:02 -0400
Subject: [PATCH] P4 to Git Change 1969318 by jatang@jatang_win_pal_lc on
2019/07/17 16:23:50
SWDEV-174198 - Put back the fix of segfault running integer_ops.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#80 edit
[ROCm/clr commit: 44401e2509d1368e267843b3d9029088bbcf387e]
---
projects/clr/rocclr/runtime/device/rocm/rocvirtual.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/projects/clr/rocclr/runtime/device/rocm/rocvirtual.cpp b/projects/clr/rocclr/runtime/device/rocm/rocvirtual.cpp
index a5be1940bf..f6af73f13f 100644
--- a/projects/clr/rocclr/runtime/device/rocm/rocvirtual.cpp
+++ b/projects/clr/rocclr/runtime/device/rocm/rocvirtual.cpp
@@ -605,6 +605,9 @@ VirtualGPU::~VirtualGPU() {
virtualQueue_->release();
}
+ // Lock the device to make the following thread safe
+ amd::ScopedLock lock(roc_device_.vgpusAccess());
+
--roc_device_.numOfVgpus_; // Virtual gpu unique index decrementing
roc_device_.vgpus_.erase(roc_device_.vgpus_.begin() + index());
for (uint idx = index(); idx < roc_device_.vgpus().size(); ++idx) {