1 /*
2  * Copyright (C) 2020-2021 Intel Corporation
3  *
4  * SPDX-License-Identifier: MIT
5  *
6  */
7 
8 #pragma once
9 #include "shared/source/helpers/app_resource_defines.h"
10 #include "shared/source/helpers/basic_math.h"
11 #include "shared/source/helpers/common_types.h"
12 #include "shared/source/helpers/constants.h"
13 
14 #include <cstdint>
15 
16 namespace NEO {
17 struct StorageInfo {
18     StorageInfo() = default;
StorageInfoStorageInfo19     StorageInfo(DeviceBitfield memoryBanks, DeviceBitfield pageTablesVisibility)
20         : memoryBanks(memoryBanks), pageTablesVisibility(pageTablesVisibility){};
21     uint32_t getNumBanks() const;
22     DeviceBitfield memoryBanks;
23     DeviceBitfield pageTablesVisibility;
24     DeviceBitfield subDeviceBitfield;
25     bool cloningOfPageTables = true;
26     bool tileInstanced = false;
27     bool multiStorage = false;
28     ColouringPolicy colouringPolicy = ColouringPolicy::DeviceCountBased;
29     size_t colouringGranularity = MemoryConstants::pageSize64k;
30     bool readOnlyMultiStorage = false;
31     bool cpuVisibleSegment = false;
32     bool isLockable = false;
33     bool localOnlyRequired = false;
34     char resourceTag[AppResourceDefines::maxStrLen + 1] = "";
getMemoryBanksStorageInfo35     uint32_t getMemoryBanks() const { return static_cast<uint32_t>(memoryBanks.to_ulong()); }
getTotalBanksCntStorageInfo36     uint32_t getTotalBanksCnt() const { return Math::log2(getMemoryBanks()) + 1; }
37 };
38 } // namespace NEO
39