Files
compute-runtime/shared/source/memory_manager/memory_operations_handler.h
Mateusz Hoppe b3d72ddd3d fix: write memory for resident allocations in simulation mode
- refactor and call proceesFlushResdiency() on memoryOperationsHandler
- call free() to remove allocation from resident allocations when
graphics allocation is released

Related-To: NEO-11719

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2024-06-14 18:49:01 +02:00

34 lines
1.3 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 CommandStreamReceiver;
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 free(Device *device, GraphicsAllocation &gfxAllocation) { return MemoryOperationsStatus::success; }
virtual MemoryOperationsStatus makeResidentWithinOsContext(OsContext *osContext, ArrayRef<GraphicsAllocation *> gfxAllocations, bool evictable) = 0;
virtual MemoryOperationsStatus evictWithinOsContext(OsContext *osContext, GraphicsAllocation &gfxAllocation) = 0;
virtual void processFlushResidency(CommandStreamReceiver *csr) {}
};
} // namespace NEO