SWDEV-330649 - Fix for QCD app crash

Change-Id: If85eb06083d2f7dbe69cde6fbd5ac54979d25693


[ROCm/clr commit: 2f973fb38b]
Esse commit está contido em:
Sarbojit Sarkar authored and Maneesh Gupta committed 2022-04-29 05:37:33 -04:00
1 pai 79084d9dc3
commit 3a0462c981
1 file changed
+2
+2
Ver Arquivo
@@ -165,6 +165,7 @@ void Memory::initDeviceMemory() {
// ================================================================================================
void Memory::resetAllocationState() {
// Reset device memory allocation state
for (size_t i = 0; i < context_().devices().size(); i++) {
deviceAlloced_[context_().devices()[i]].store(AllocInit, std::memory_order_relaxed);
@@ -322,6 +323,7 @@ bool Memory::addDeviceMemory(const Device* dev) {
AllocState create = AllocCreate;
AllocState init = AllocInit;
amd::ScopedLock lock(lockMemoryOps());
if (deviceAlloced_[dev].compare_exchange_strong(init, create, std::memory_order_acq_rel)) {
// Check if runtime already allocated all available slots for device memory
if (numDevices() == NumDevicesWithP2P()) {