2019-02-15 18:31:47 +08:00
|
|
|
/*
|
2021-05-17 02:51:16 +08:00
|
|
|
* Copyright (C) 2020-2021 Intel Corporation
|
2019-02-15 18:31:47 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2021-04-24 00:43:48 +08:00
|
|
|
#include "shared/source/helpers/app_resource_defines.h"
|
2021-10-04 23:23:42 +08:00
|
|
|
#include "shared/source/helpers/basic_math.h"
|
2021-04-24 00:43:48 +08:00
|
|
|
#include "shared/source/helpers/common_types.h"
|
2021-10-04 23:23:42 +08:00
|
|
|
#include "shared/source/helpers/constants.h"
|
2021-04-24 00:43:48 +08:00
|
|
|
|
2019-03-07 22:14:11 +08:00
|
|
|
#include <cstdint>
|
2021-04-24 00:43:48 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2019-02-28 23:12:23 +08:00
|
|
|
struct StorageInfo {
|
2021-04-24 00:43:48 +08:00
|
|
|
StorageInfo() = default;
|
|
|
|
StorageInfo(DeviceBitfield memoryBanks, DeviceBitfield pageTablesVisibility)
|
|
|
|
: memoryBanks(memoryBanks), pageTablesVisibility(pageTablesVisibility){};
|
2020-04-21 19:16:45 +08:00
|
|
|
uint32_t getNumBanks() const;
|
2021-04-24 00:43:48 +08:00
|
|
|
DeviceBitfield memoryBanks;
|
|
|
|
DeviceBitfield pageTablesVisibility;
|
2021-08-04 19:56:36 +08:00
|
|
|
DeviceBitfield subDeviceBitfield;
|
2021-04-24 00:43:48 +08:00
|
|
|
bool cloningOfPageTables = true;
|
|
|
|
bool tileInstanced = false;
|
2020-04-21 19:16:45 +08:00
|
|
|
bool multiStorage = false;
|
2021-10-04 23:23:42 +08:00
|
|
|
ColouringPolicy colouringPolicy = ColouringPolicy::DeviceCountBased;
|
|
|
|
size_t colouringGranularity = MemoryConstants::pageSize64k;
|
2021-04-24 00:43:48 +08:00
|
|
|
bool readOnlyMultiStorage = false;
|
|
|
|
bool cpuVisibleSegment = false;
|
2021-05-14 03:42:16 +08:00
|
|
|
bool isLockable = false;
|
2021-04-24 00:43:48 +08:00
|
|
|
bool localOnlyRequired = false;
|
|
|
|
char resourceTag[AppResourceDefines::maxStrLen + 1] = "";
|
|
|
|
uint32_t getMemoryBanks() const { return static_cast<uint32_t>(memoryBanks.to_ulong()); }
|
2021-10-04 23:23:42 +08:00
|
|
|
uint32_t getTotalBanksCnt() const { return Math::log2(getMemoryBanks()) + 1; }
|
2019-02-15 18:31:47 +08:00
|
|
|
};
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|