SWDEV-330649 - Fix for QCD app crash

Change-Id: If85eb06083d2f7dbe69cde6fbd5ac54979d25693


[ROCm/clr commit: 2f973fb38b]
이 커밋은 다음에 포함됨:
Sarbojit Sarkar 작성하고 Maneesh Gupta가 2022-04-29 05:37:33 -04:00를 커밋함
1 부모 79084d9dc3
커밋 3a0462c981
1 파일이 변경됨
+2
+2
파일 보기
@@ -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()) {