diff --git a/level_zero/core/source/cmdlist/cmdlist.cpp b/level_zero/core/source/cmdlist/cmdlist.cpp index ec51632cbf..2eeb943934 100644 --- a/level_zero/core/source/cmdlist/cmdlist.cpp +++ b/level_zero/core/source/cmdlist/cmdlist.cpp @@ -138,16 +138,13 @@ NEO::PreemptionMode CommandList::obtainFunctionPreemptionMode(Kernel *kernel) { void CommandList::makeResidentAndMigrate(bool performMigration) { for (auto alloc : commandContainer.getResidencyContainer()) { - if (csr->getResidencyAllocations().end() == - std::find(csr->getResidencyAllocations().begin(), csr->getResidencyAllocations().end(), alloc)) { - csr->makeResident(*alloc); + csr->makeResident(*alloc); - if (performMigration && - (alloc->getAllocationType() == NEO::GraphicsAllocation::AllocationType::SVM_GPU || - alloc->getAllocationType() == NEO::GraphicsAllocation::AllocationType::SVM_CPU)) { - auto pageFaultManager = device->getDriverHandle()->getMemoryManager()->getPageFaultManager(); - pageFaultManager->moveAllocationToGpuDomain(reinterpret_cast(alloc->getGpuAddress())); - } + if (performMigration && + (alloc->getAllocationType() == NEO::GraphicsAllocation::AllocationType::SVM_GPU || + alloc->getAllocationType() == NEO::GraphicsAllocation::AllocationType::SVM_CPU)) { + auto pageFaultManager = device->getDriverHandle()->getMemoryManager()->getPageFaultManager(); + pageFaultManager->moveAllocationToGpuDomain(reinterpret_cast(alloc->getGpuAddress())); } } }