2018-10-09 17:50:58 +08:00
|
|
|
/*
|
2022-02-04 21:59:01 +08:00
|
|
|
* Copyright (C) 2018-2022 Intel Corporation
|
2018-10-09 17:50:58 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/memory_manager/graphics_allocation.h"
|
2020-06-10 17:49:34 +08:00
|
|
|
#include "shared/source/memory_manager/memory_manager.h"
|
2022-07-08 02:33:25 +08:00
|
|
|
#include "shared/source/utilities/idlist.h"
|
2018-10-09 17:50:58 +08:00
|
|
|
|
2022-07-08 02:33:25 +08:00
|
|
|
#include <memory>
|
2019-09-17 23:11:10 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2018-11-02 17:01:56 +08:00
|
|
|
class CommandStreamReceiver;
|
2018-10-09 17:50:58 +08:00
|
|
|
|
|
|
|
class AllocationsList : public IDList<GraphicsAllocation, true, true> {
|
|
|
|
public:
|
2022-07-08 02:33:25 +08:00
|
|
|
AllocationsList() = default;
|
2020-06-10 17:49:34 +08:00
|
|
|
AllocationsList(AllocationUsage allocationUsage);
|
2022-07-08 02:33:25 +08:00
|
|
|
|
2022-02-04 21:59:01 +08:00
|
|
|
std::unique_ptr<GraphicsAllocation> detachAllocation(size_t requiredMinimalSize, const void *requiredPtr, CommandStreamReceiver *commandStreamReceiver, AllocationType allocationType);
|
2021-08-16 23:31:09 +08:00
|
|
|
void freeAllGraphicsAllocations(Device *neoDevice);
|
2018-10-09 17:50:58 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
GraphicsAllocation *detachAllocationImpl(GraphicsAllocation *, void *);
|
2020-06-10 17:49:34 +08:00
|
|
|
|
2022-07-08 02:33:25 +08:00
|
|
|
const AllocationUsage allocationUsage{REUSABLE_ALLOCATION};
|
2018-10-09 17:50:58 +08:00
|
|
|
};
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|