2020-08-27 14:55:09 +08:00
|
|
|
/*
|
2022-02-04 21:59:01 +08:00
|
|
|
* Copyright (C) 2020-2022 Intel Corporation
|
2020-08-27 14:55:09 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2022-05-18 03:04:23 +08:00
|
|
|
#include <cstdint>
|
2020-08-27 14:55:09 +08:00
|
|
|
|
|
|
|
namespace NEO {
|
2022-12-16 00:01:37 +08:00
|
|
|
enum class AllocationType;
|
2022-05-18 03:04:23 +08:00
|
|
|
enum class HeapIndex : uint32_t;
|
2020-08-27 14:55:09 +08:00
|
|
|
struct HardwareInfo;
|
2022-05-18 03:04:23 +08:00
|
|
|
|
2020-08-27 14:55:09 +08:00
|
|
|
struct HeapAssigner {
|
|
|
|
HeapAssigner();
|
|
|
|
~HeapAssigner() = default;
|
2022-02-04 21:59:01 +08: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-24 02:28:16 +08:00
|
|
|
static bool heapTypeExternalWithFrontWindowPool(HeapIndex heap);
|
2020-10-14 15:50:07 +08:00
|
|
|
static bool isInternalHeap(HeapIndex heap);
|
2020-08-27 14:55:09 +08:00
|
|
|
|
2020-09-14 21:14:11 +08:00
|
|
|
static HeapIndex mapExternalWindowIndex(HeapIndex index);
|
2020-10-14 15:50:07 +08:00
|
|
|
static HeapIndex mapInternalWindowIndex(HeapIndex index);
|
2020-08-27 14:55:09 +08:00
|
|
|
bool apiAllowExternalHeapForSshAndDsh = false;
|
|
|
|
};
|
2022-05-18 03:04:23 +08:00
|
|
|
} // namespace NEO
|