fix: add cpu alloc to eviction list only once

Related-To: NEO-12572

Also, before migration to GPU domain, remove it from this list

Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek
2024-09-30 12:34:23 +00:00
committed by Compute-Runtime-Automation
parent 9db83b8231
commit b2fd1972a4
14 changed files with 73 additions and 24 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2023 Intel Corporation
* Copyright (C) 2019-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -33,7 +33,7 @@ void PageFaultManager::transferToGpu(void *ptr, void *cmdQ) {
UNRECOVERABLE_IF(allocData == nullptr);
this->evictMemoryAfterImplCopy(allocData->cpuAllocation, &commandQueue->getDevice());
}
void PageFaultManager::allowCPUMemoryEviction(void *ptr, PageFaultData &pageFaultData) {
void PageFaultManager::allowCPUMemoryEviction(bool evict, void *ptr, PageFaultData &pageFaultData) {
auto commandQueue = static_cast<CommandQueue *>(pageFaultData.cmdQ);
auto allocData = memoryData[ptr].unifiedMemoryManager->getSVMAlloc(ptr);
@@ -42,7 +42,7 @@ void PageFaultManager::allowCPUMemoryEviction(void *ptr, PageFaultData &pageFaul
auto &csr = commandQueue->selectCsrForBuiltinOperation(csrSelectionArgs);
auto osInterface = commandQueue->getDevice().getRootDeviceEnvironment().osInterface.get();
allowCPUMemoryEvictionImpl(ptr, csr, osInterface);
allowCPUMemoryEvictionImpl(evict, ptr, csr, osInterface);
}
} // namespace NEO

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2023 Intel Corporation
* Copyright (C) 2019-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -124,7 +124,7 @@ TEST_F(PageFaultManagerTest, givenUnifiedMemoryAllocWhenAllowCPUMemoryEvictionIs
NEO::PageFaultManager::PageFaultData pageData;
pageData.cmdQ = cmdQ.get();
pageFaultManager->baseAllowCPUMemoryEviction(alloc, pageData);
pageFaultManager->baseAllowCPUMemoryEviction(true, alloc, pageData);
EXPECT_EQ(pageFaultManager->allowCPUMemoryEvictionImplCalled, 1);
auto allocData = svmAllocsManager->getSVMAlloc(alloc);