2020-08-27 08:55:09 +02:00
|
|
|
/*
|
2023-10-19 14:24:35 +00:00
|
|
|
* Copyright (C) 2020-2023 Intel Corporation
|
2020-08-27 08:55:09 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
2022-05-17 19:04:23 +00:00
|
|
|
#include <cstdint>
|
2020-08-27 08:55:09 +02:00
|
|
|
|
|
|
|
|
namespace NEO {
|
2022-12-15 16:01:37 +00:00
|
|
|
enum class AllocationType;
|
2022-05-17 19:04:23 +00:00
|
|
|
enum class HeapIndex : uint32_t;
|
2020-08-27 08:55:09 +02:00
|
|
|
struct HardwareInfo;
|
2022-05-17 19:04:23 +00:00
|
|
|
|
2020-08-27 08:55:09 +02:00
|
|
|
struct HeapAssigner {
|
2023-10-19 14:24:35 +00:00
|
|
|
HeapAssigner(bool allowExternalHeap);
|
2020-08-27 08:55:09 +02:00
|
|
|
~HeapAssigner() = default;
|
2022-02-04 13:59:01 +00:00
|
|
|
bool useExternal32BitHeap(AllocationType allocType);
|
|
|
|
|
bool useInternal32BitHeap(AllocationType allocType);
|
|
|
|
|
bool use32BitHeap(AllocationType allocType);
|
|
|
|
|
HeapIndex get32BitHeapIndex(AllocationType allocType, bool useLocalMem, const HardwareInfo &hwInfo, bool useFrontWindow);
|
2020-12-23 18:28:16 +00:00
|
|
|
static bool heapTypeExternalWithFrontWindowPool(HeapIndex heap);
|
2020-10-14 09:50:07 +02:00
|
|
|
static bool isInternalHeap(HeapIndex heap);
|
2020-08-27 08:55:09 +02:00
|
|
|
|
2020-09-14 15:14:11 +02:00
|
|
|
static HeapIndex mapExternalWindowIndex(HeapIndex index);
|
2020-10-14 09:50:07 +02:00
|
|
|
static HeapIndex mapInternalWindowIndex(HeapIndex index);
|
2020-08-27 08:55:09 +02:00
|
|
|
bool apiAllowExternalHeapForSshAndDsh = false;
|
|
|
|
|
};
|
2022-05-17 19:04:23 +00:00
|
|
|
} // namespace NEO
|