2019-11-18 22:12:22 +08:00
|
|
|
/*
|
2020-02-23 05:21:06 +08:00
|
|
|
* Copyright (C) 2019-2020 Intel Corporation
|
2019-11-18 22:12:22 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
|
|
|
|
class MemoryManager;
|
|
|
|
class GraphicsAllocation;
|
|
|
|
class InternalAllocationStorage;
|
|
|
|
|
|
|
|
class HeapHelper {
|
|
|
|
public:
|
2020-03-19 17:29:36 +08:00
|
|
|
HeapHelper(MemoryManager *memManager, InternalAllocationStorage *storageForReuse, bool isMultiOsContextCapable) : isMultiOsContextCapable(isMultiOsContextCapable),
|
|
|
|
storageForReuse(storageForReuse),
|
|
|
|
memManager(memManager) {}
|
2019-12-17 14:57:45 +08:00
|
|
|
GraphicsAllocation *getHeapAllocation(uint32_t heapType, size_t heapSize, size_t alignment, uint32_t rootDeviceIndex);
|
2019-11-18 22:12:22 +08:00
|
|
|
void storeHeapAllocation(GraphicsAllocation *heapAllocation);
|
2020-03-19 17:29:36 +08:00
|
|
|
bool isMultiOsContextCapable = false;
|
2019-11-18 22:12:22 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
InternalAllocationStorage *storageForReuse = nullptr;
|
|
|
|
MemoryManager *memManager = nullptr;
|
|
|
|
};
|
|
|
|
} // namespace NEO
|