feature: support explicit memory locking

Added lockMemory in context to explicitly locking memory,
Added a boolean flag in graphics_allocation to indicate the allocation
is locked, and modified memory_operations_handler to add lock().
Change the logic to work correctly with makeResident() when lock() is
called previously for the same memory region

Related-To: NEO-8277
Signed-off-by: Young Jin Yoon <young.jin.yoon@intel.com>
This commit is contained in:
Young Jin Yoon
2024-03-22 06:51:12 +00:00
committed by Compute-Runtime-Automation
parent d41f508e43
commit 27a3307bb0
48 changed files with 644 additions and 129 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2023 Intel Corporation
* Copyright (C) 2019-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -69,6 +69,10 @@ MemoryOperationsStatus AubMemoryOperationsHandler::makeResident(Device *device,
return MemoryOperationsStatus::success;
}
MemoryOperationsStatus AubMemoryOperationsHandler::lock(Device *device, ArrayRef<GraphicsAllocation *> gfxAllocations) {
return makeResident(device, gfxAllocations);
}
MemoryOperationsStatus AubMemoryOperationsHandler::evict(Device *device, GraphicsAllocation &gfxAllocation) {
auto lock = acquireLock(resourcesLock);
auto itor = std::find(residentAllocations.begin(), residentAllocations.end(), &gfxAllocation);