2
0

SWDEV-330649 - Fix for QCD app crash

Change-Id: If85eb06083d2f7dbe69cde6fbd5ac54979d25693
Este cometimento está contido em:
Sarbojit Sarkar
2022-04-27 11:12:18 +00:00
cometido por Maneesh Gupta
ascendente 4e225346fa
cometimento 2f973fb38b
+2
Ver ficheiro
@@ -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()) {