mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 09:59:39 +08:00
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(). Related-To: NEO-8277 Signed-off-by: Young Jin Yoon <young.jin.yoon@intel.com>
31 lines
1.1 KiB
C++
31 lines
1.1 KiB
C++
/*
|
|
* Copyright (C) 2019-2024 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include "shared/source/memory_manager/memory_operations_status.h"
|
|
#include "shared/source/utilities/arrayref.h"
|
|
|
|
namespace NEO {
|
|
class Device;
|
|
class GraphicsAllocation;
|
|
class OsContext;
|
|
|
|
class MemoryOperationsHandler {
|
|
public:
|
|
MemoryOperationsHandler() = default;
|
|
virtual ~MemoryOperationsHandler() = default;
|
|
|
|
virtual MemoryOperationsStatus makeResident(Device *device, ArrayRef<GraphicsAllocation *> gfxAllocations) = 0;
|
|
virtual MemoryOperationsStatus lock(Device *device, ArrayRef<GraphicsAllocation *> gfxAllocations) = 0;
|
|
virtual MemoryOperationsStatus evict(Device *device, GraphicsAllocation &gfxAllocation) = 0;
|
|
virtual MemoryOperationsStatus isResident(Device *device, GraphicsAllocation &gfxAllocation) = 0;
|
|
|
|
virtual MemoryOperationsStatus makeResidentWithinOsContext(OsContext *osContext, ArrayRef<GraphicsAllocation *> gfxAllocations, bool evictable) = 0;
|
|
virtual MemoryOperationsStatus evictWithinOsContext(OsContext *osContext, GraphicsAllocation &gfxAllocation) = 0;
|
|
};
|
|
} // namespace NEO
|