Improve logic in addInternalAllocationsToResidencyContainer

Change-Id: I0be0082d2d70623867b691629cac09f5d653fc0d
Signed-off: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
Jaime Arteaga
2020-07-13 12:59:16 -07:00
committed by sys_ocldev
parent 4b6f8b415e
commit 74ac02e1f3
3 changed files with 74 additions and 22 deletions

View File

@@ -75,12 +75,8 @@ void SVMAllocsManager::addInternalAllocationsToResidencyContainer(uint32_t rootD
uint32_t requestedTypesMask) {
std::unique_lock<SpinLock> lock(mtx);
for (auto &allocation : this->SVMAllocs.allocations) {
if (!(allocation.second.memoryType & requestedTypesMask)) {
continue;
}
if ((allocation.second.memoryType & InternalMemoryType::DEVICE_UNIFIED_MEMORY ||
allocation.second.memoryType & InternalMemoryType::SHARED_UNIFIED_MEMORY) &&
(static_cast<Device *>(allocation.second.device)->getRootDeviceIndex() != rootDeviceIndex)) {
if (!(allocation.second.memoryType & requestedTypesMask) ||
(nullptr == allocation.second.gpuAllocations.getGraphicsAllocation(rootDeviceIndex))) {
continue;
}
residencyContainer.push_back(allocation.second.gpuAllocations.getGraphicsAllocation(rootDeviceIndex));