fix: Use stack vec for api specific prefix
Related-To: NEO-8388, GSD-6296 Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
parent
42496ac96d
commit
8658fdb04e
|
@ -14,8 +14,8 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace NEO {
|
namespace NEO {
|
||||||
std::vector<const char *> validL0Prefixes;
|
StackVec<const char *, 4> validL0Prefixes;
|
||||||
std::vector<NEO::DebugVarPrefix> validL0PrefixTypes;
|
StackVec<NEO::DebugVarPrefix, 4> validL0PrefixTypes;
|
||||||
bool ApiSpecificConfig::isStatelessCompressionSupported() {
|
bool ApiSpecificConfig::isStatelessCompressionSupported() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -61,11 +61,11 @@ void ApiSpecificConfig::initPrefixes() {
|
||||||
validL0PrefixTypes = {DebugVarPrefix::Neo_L0, DebugVarPrefix::Neo, DebugVarPrefix::None};
|
validL0PrefixTypes = {DebugVarPrefix::Neo_L0, DebugVarPrefix::Neo, DebugVarPrefix::None};
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<const char *> &ApiSpecificConfig::getPrefixStrings() {
|
const StackVec<const char *, 4> &ApiSpecificConfig::getPrefixStrings() {
|
||||||
return validL0Prefixes;
|
return validL0Prefixes;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<DebugVarPrefix> &ApiSpecificConfig::getPrefixTypes() {
|
const StackVec<DebugVarPrefix, 4> &ApiSpecificConfig::getPrefixTypes() {
|
||||||
return validL0PrefixTypes;
|
return validL0PrefixTypes;
|
||||||
}
|
}
|
||||||
} // namespace NEO
|
} // namespace NEO
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace NEO {
|
namespace NEO {
|
||||||
std::vector<const char *> validClPrefixes;
|
StackVec<const char *, 4> validClPrefixes;
|
||||||
std::vector<NEO::DebugVarPrefix> validClPrefixTypes;
|
StackVec<NEO::DebugVarPrefix, 4> validClPrefixTypes;
|
||||||
bool ApiSpecificConfig::isStatelessCompressionSupported() {
|
bool ApiSpecificConfig::isStatelessCompressionSupported() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -61,11 +61,11 @@ void ApiSpecificConfig::initPrefixes() {
|
||||||
validClPrefixTypes = {DebugVarPrefix::Neo_Ocl, DebugVarPrefix::Neo, DebugVarPrefix::None};
|
validClPrefixTypes = {DebugVarPrefix::Neo_Ocl, DebugVarPrefix::Neo, DebugVarPrefix::None};
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<const char *> &ApiSpecificConfig::getPrefixStrings() {
|
const StackVec<const char *, 4> &ApiSpecificConfig::getPrefixStrings() {
|
||||||
return validClPrefixes;
|
return validClPrefixes;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<DebugVarPrefix> &ApiSpecificConfig::getPrefixTypes() {
|
const StackVec<DebugVarPrefix, 4> &ApiSpecificConfig::getPrefixTypes() {
|
||||||
return validClPrefixTypes;
|
return validClPrefixTypes;
|
||||||
}
|
}
|
||||||
} // namespace NEO
|
} // namespace NEO
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||||
|
#include "shared/source/utilities/stackvec.h"
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -27,8 +28,8 @@ struct ApiSpecificConfig {
|
||||||
static uint64_t getReducedMaxAllocSize(uint64_t maxAllocSize);
|
static uint64_t getReducedMaxAllocSize(uint64_t maxAllocSize);
|
||||||
static const char *getRegistryPath();
|
static const char *getRegistryPath();
|
||||||
static void initPrefixes();
|
static void initPrefixes();
|
||||||
static const std::vector<const char *> &getPrefixStrings();
|
static const StackVec<const char *, 4> &getPrefixStrings();
|
||||||
static const std::vector<DebugVarPrefix> &getPrefixTypes();
|
static const StackVec<DebugVarPrefix, 4> &getPrefixTypes();
|
||||||
static std::string getAubPrefixForSpecificApi() {
|
static std::string getAubPrefixForSpecificApi() {
|
||||||
return (getName() + "_");
|
return (getName() + "_");
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,8 +38,8 @@ int64_t EnvironmentVariableReader::getSetting(const char *settingName, int64_t d
|
||||||
int64_t value = defaultValue;
|
int64_t value = defaultValue;
|
||||||
char *envValue;
|
char *envValue;
|
||||||
|
|
||||||
const std::vector<const char *> prefixString = ApiSpecificConfig::getPrefixStrings();
|
auto prefixString = ApiSpecificConfig::getPrefixStrings();
|
||||||
const std::vector<NEO::DebugVarPrefix> prefixType = ApiSpecificConfig::getPrefixTypes();
|
auto prefixType = ApiSpecificConfig::getPrefixTypes();
|
||||||
uint32_t i = 0;
|
uint32_t i = 0;
|
||||||
|
|
||||||
for (const auto &prefix : prefixString) {
|
for (const auto &prefix : prefixString) {
|
||||||
|
@ -73,8 +73,8 @@ std::string EnvironmentVariableReader::getSetting(const char *settingName, const
|
||||||
std::string keyValue;
|
std::string keyValue;
|
||||||
keyValue.assign(value);
|
keyValue.assign(value);
|
||||||
|
|
||||||
const std::vector<const char *> prefixString = ApiSpecificConfig::getPrefixStrings();
|
auto prefixString = ApiSpecificConfig::getPrefixStrings();
|
||||||
const std::vector<DebugVarPrefix> prefixType = ApiSpecificConfig::getPrefixTypes();
|
auto prefixType = ApiSpecificConfig::getPrefixTypes();
|
||||||
|
|
||||||
uint32_t i = 0;
|
uint32_t i = 0;
|
||||||
for (const auto &prefix : prefixString) {
|
for (const auto &prefix : prefixString) {
|
||||||
|
|
|
@ -92,8 +92,8 @@ int64_t RegistryReader::getSetting(const char *settingName, int64_t defaultValue
|
||||||
if (!(getSettingIntCommon(settingName, value))) {
|
if (!(getSettingIntCommon(settingName, value))) {
|
||||||
char *envValue;
|
char *envValue;
|
||||||
|
|
||||||
const std::vector<const char *> prefixString = ApiSpecificConfig::getPrefixStrings();
|
auto prefixString = ApiSpecificConfig::getPrefixStrings();
|
||||||
const std::vector<DebugVarPrefix> prefixType = ApiSpecificConfig::getPrefixTypes();
|
auto prefixType = ApiSpecificConfig::getPrefixTypes();
|
||||||
|
|
||||||
uint32_t i = 0;
|
uint32_t i = 0;
|
||||||
for (const auto &prefix : prefixString) {
|
for (const auto &prefix : prefixString) {
|
||||||
|
@ -190,8 +190,8 @@ std::string RegistryReader::getSetting(const char *settingName, const std::strin
|
||||||
if (!(getSettingStringCommon(settingName, keyValue))) {
|
if (!(getSettingStringCommon(settingName, keyValue))) {
|
||||||
char *envValue;
|
char *envValue;
|
||||||
|
|
||||||
const std::vector<const char *> prefixString = ApiSpecificConfig::getPrefixStrings();
|
auto prefixString = ApiSpecificConfig::getPrefixStrings();
|
||||||
const std::vector<DebugVarPrefix> prefixType = ApiSpecificConfig::getPrefixTypes();
|
auto prefixType = ApiSpecificConfig::getPrefixTypes();
|
||||||
|
|
||||||
uint32_t i = 0;
|
uint32_t i = 0;
|
||||||
for (const auto &prefix : prefixString) {
|
for (const auto &prefix : prefixString) {
|
||||||
|
|
|
@ -42,8 +42,8 @@ int32_t SettingsFileReader::getSetting(const char *settingName, int32_t defaultV
|
||||||
int64_t SettingsFileReader::getSetting(const char *settingName, int64_t defaultValue, DebugVarPrefix &type) {
|
int64_t SettingsFileReader::getSetting(const char *settingName, int64_t defaultValue, DebugVarPrefix &type) {
|
||||||
int64_t value = defaultValue;
|
int64_t value = defaultValue;
|
||||||
|
|
||||||
const std::vector<const char *> prefixString = ApiSpecificConfig::getPrefixStrings();
|
auto prefixString = ApiSpecificConfig::getPrefixStrings();
|
||||||
const std::vector<DebugVarPrefix> prefixType = ApiSpecificConfig::getPrefixTypes();
|
auto prefixType = ApiSpecificConfig::getPrefixTypes();
|
||||||
|
|
||||||
uint32_t i = 0;
|
uint32_t i = 0;
|
||||||
for (const auto &prefix : prefixString) {
|
for (const auto &prefix : prefixString) {
|
||||||
|
@ -83,8 +83,8 @@ bool SettingsFileReader::getSetting(const char *settingName, bool defaultValue)
|
||||||
std::string SettingsFileReader::getSetting(const char *settingName, const std::string &value, DebugVarPrefix &type) {
|
std::string SettingsFileReader::getSetting(const char *settingName, const std::string &value, DebugVarPrefix &type) {
|
||||||
std::string returnValue = value;
|
std::string returnValue = value;
|
||||||
|
|
||||||
const std::vector<const char *> prefixString = ApiSpecificConfig::getPrefixStrings();
|
auto prefixString = ApiSpecificConfig::getPrefixStrings();
|
||||||
const std::vector<DebugVarPrefix> prefixType = ApiSpecificConfig::getPrefixTypes();
|
auto prefixType = ApiSpecificConfig::getPrefixTypes();
|
||||||
|
|
||||||
uint32_t i = 0;
|
uint32_t i = 0;
|
||||||
for (const auto &prefix : prefixString) {
|
for (const auto &prefix : prefixString) {
|
||||||
|
|
|
@ -25,10 +25,10 @@ bool apiSupport = false;
|
||||||
} // namespace ImplicitScaling
|
} // namespace ImplicitScaling
|
||||||
|
|
||||||
const char *neoMockSettingsFileName = "neo_mock.config";
|
const char *neoMockSettingsFileName = "neo_mock.config";
|
||||||
std::vector<const char *> validUltL0Prefixes = {"NEO_L0_", "NEO_", ""};
|
StackVec<const char *, 4> validUltL0Prefixes = {"NEO_L0_", "NEO_", ""};
|
||||||
std::vector<NEO::DebugVarPrefix> validUltL0PrefixTypes = {DebugVarPrefix::Neo_L0, DebugVarPrefix::Neo, DebugVarPrefix::None};
|
StackVec<NEO::DebugVarPrefix, 4> validUltL0PrefixTypes = {DebugVarPrefix::Neo_L0, DebugVarPrefix::Neo, DebugVarPrefix::None};
|
||||||
std::vector<const char *> validUltOclPrefixes = {"NEO_OCL_", "NEO_", ""};
|
StackVec<const char *, 4> validUltOclPrefixes = {"NEO_OCL_", "NEO_", ""};
|
||||||
std::vector<NEO::DebugVarPrefix> validUltOclPrefixTypes = {DebugVarPrefix::Neo_Ocl, DebugVarPrefix::Neo, DebugVarPrefix::None};
|
StackVec<NEO::DebugVarPrefix, 4> validUltOclPrefixTypes = {DebugVarPrefix::Neo_Ocl, DebugVarPrefix::Neo, DebugVarPrefix::None};
|
||||||
|
|
||||||
bool CompressionSelector::preferCompressedAllocation(const AllocationProperties &properties) {
|
bool CompressionSelector::preferCompressedAllocation(const AllocationProperties &properties) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -88,7 +88,7 @@ const char *ApiSpecificConfig::getRegistryPath() {
|
||||||
void ApiSpecificConfig::initPrefixes() {
|
void ApiSpecificConfig::initPrefixes() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<const char *> &ApiSpecificConfig::getPrefixStrings() {
|
const StackVec<const char *, 4> &ApiSpecificConfig::getPrefixStrings() {
|
||||||
if (apiTypeForUlts == ApiSpecificConfig::L0) {
|
if (apiTypeForUlts == ApiSpecificConfig::L0) {
|
||||||
return validUltL0Prefixes;
|
return validUltL0Prefixes;
|
||||||
} else {
|
} else {
|
||||||
|
@ -96,7 +96,7 @@ const std::vector<const char *> &ApiSpecificConfig::getPrefixStrings() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<DebugVarPrefix> &ApiSpecificConfig::getPrefixTypes() {
|
const StackVec<DebugVarPrefix, 4> &ApiSpecificConfig::getPrefixTypes() {
|
||||||
if (apiTypeForUlts == ApiSpecificConfig::L0) {
|
if (apiTypeForUlts == ApiSpecificConfig::L0) {
|
||||||
return validUltL0PrefixTypes;
|
return validUltL0PrefixTypes;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue