Remove not needed std::vector copies

Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2022-11-07 19:54:52 +00:00
committed by Compute-Runtime-Automation
parent 6da32a9c5e
commit bf64769807
6 changed files with 17 additions and 17 deletions

View File

@ -13,7 +13,7 @@ namespace NEO {
TEST_P(OclocProductConfigTests, GivenProductConfigValuesWhenInitHardwareInfoThenCorrectValuesAreSet) {
auto deviceId = 0u;
auto revId = 0u;
auto allSupportedConfigs = mockOfflineCompiler->argHelper->productConfigHelper->getDeviceAotInfo();
auto &allSupportedConfigs = mockOfflineCompiler->argHelper->productConfigHelper->getDeviceAotInfo();
for (const auto &deviceConfig : allSupportedConfigs) {
if (aotConfig.ProductConfig == deviceConfig.aotConfig.ProductConfig) {

View File

@ -189,7 +189,7 @@ TEST_F(MultiCommandTests, GivenSpecifiedOutputDirWhenBuildingMultiCommandThenSuc
}
TEST_F(MultiCommandTests, GivenSpecifiedOutputDirWithProductConfigValueWhenBuildingMultiCommandThenSuccessIsReturned) {
auto allEnabledDeviceConfigs = oclocArgHelperWithoutInput->productConfigHelper->getDeviceAotInfo();
auto &allEnabledDeviceConfigs = oclocArgHelperWithoutInput->productConfigHelper->getDeviceAotInfo();
if (allEnabledDeviceConfigs.empty()) {
GTEST_SKIP();
}
@ -526,7 +526,7 @@ TEST(MultiCommandWhiteboxTest, GivenInvalidArgsWhenInitializingThenErrorIsReturn
using MockOfflineCompilerTests = ::testing::Test;
TEST_F(MockOfflineCompilerTests, givenProductConfigValueAndRevisionIdWhenInitHwInfoThenTheseValuesAreSet) {
MockOfflineCompiler mockOfflineCompiler;
auto allEnabledDeviceConfigs = mockOfflineCompiler.argHelper->productConfigHelper->getDeviceAotInfo();
auto &allEnabledDeviceConfigs = mockOfflineCompiler.argHelper->productConfigHelper->getDeviceAotInfo();
if (allEnabledDeviceConfigs.empty()) {
GTEST_SKIP();
}
@ -550,7 +550,7 @@ TEST_F(MockOfflineCompilerTests, givenProductConfigValueAndRevisionIdWhenInitHwI
TEST_F(MockOfflineCompilerTests, givenProductConfigValueWhenInitHwInfoThenBaseHardwareInfoValuesAreSet) {
MockOfflineCompiler mockOfflineCompiler;
auto allEnabledDeviceConfigs = mockOfflineCompiler.argHelper->productConfigHelper->getDeviceAotInfo();
auto &allEnabledDeviceConfigs = mockOfflineCompiler.argHelper->productConfigHelper->getDeviceAotInfo();
if (allEnabledDeviceConfigs.empty()) {
GTEST_SKIP();
}
@ -639,7 +639,7 @@ TEST_F(MockOfflineCompilerTests, givenHwInfoConfigWhenSetHwInfoForDeprecatedAcro
TEST_F(MockOfflineCompilerTests, givenAcronymWithUppercaseWhenInitHwInfoThenSuccessIsReturned) {
MockOfflineCompiler mockOfflineCompiler;
auto allEnabledDeviceConfigs = mockOfflineCompiler.argHelper->productConfigHelper->getDeviceAotInfo();
auto &allEnabledDeviceConfigs = mockOfflineCompiler.argHelper->productConfigHelper->getDeviceAotInfo();
if (allEnabledDeviceConfigs.empty()) {
GTEST_SKIP();
}
@ -676,7 +676,7 @@ TEST_F(MockOfflineCompilerTests, givenDeprecatedAcronymsWithUppercaseWhenInitHwI
HWTEST2_F(MockOfflineCompilerTests, givenProductConfigValueWhenInitHwInfoThenMaxDualSubSlicesSupportedIsSet, IsAtLeastGen12lp) {
MockOfflineCompiler mockOfflineCompiler;
auto allEnabledDeviceConfigs = mockOfflineCompiler.argHelper->productConfigHelper->getDeviceAotInfo();
auto &allEnabledDeviceConfigs = mockOfflineCompiler.argHelper->productConfigHelper->getDeviceAotInfo();
if (allEnabledDeviceConfigs.empty()) {
GTEST_SKIP();
}
@ -736,7 +736,7 @@ TEST_F(OfflineCompilerTests, givenFamilyAcronymWhenIdsCommandIsInvokeThenSuccess
if (enabledFamilies.empty()) {
GTEST_SKIP();
}
auto supportedDevicesConfigs = oclocArgHelperWithoutInput->productConfigHelper->getDeviceAotInfo();
auto &supportedDevicesConfigs = oclocArgHelperWithoutInput->productConfigHelper->getDeviceAotInfo();
for (const auto &familyAcronym : enabledFamilies) {
std::vector<std::string> expected{};
auto family = ProductConfigHelper::getFamilyForAcronym(familyAcronym.str());
@ -770,7 +770,7 @@ TEST_F(OfflineCompilerTests, givenReleaseAcronymWhenIdsCommandIsInvokeThenSucces
if (enabledReleases.empty()) {
GTEST_SKIP();
}
auto supportedDevicesConfigs = oclocArgHelperWithoutInput->productConfigHelper->getDeviceAotInfo();
auto &supportedDevicesConfigs = oclocArgHelperWithoutInput->productConfigHelper->getDeviceAotInfo();
for (const auto &releaseAcronym : enabledReleases) {
std::vector<std::string> expected{};
auto release = ProductConfigHelper::getReleaseForAcronym(releaseAcronym.str());
@ -804,7 +804,7 @@ TEST_F(OfflineCompilerTests, givenProductAcronymWhenIdsCommandIsInvokeThenSucces
if (enabledProducts.empty()) {
GTEST_SKIP();
}
auto supportedDevicesConfigs = oclocArgHelperWithoutInput->productConfigHelper->getDeviceAotInfo();
auto &supportedDevicesConfigs = oclocArgHelperWithoutInput->productConfigHelper->getDeviceAotInfo();
for (const auto &productAcronym : enabledProducts) {
std::vector<std::string> expected{};
auto product = ProductConfigHelper::getProductConfigForAcronym(productAcronym.str());
@ -1757,7 +1757,7 @@ TEST_F(OfflineCompilerTests, GivenArgsWhenBuildingThenBuildSucceeds) {
}
TEST_F(OfflineCompilerTests, GivenArgsWhenBuildingWithDeviceConfigValueThenBuildSucceeds) {
auto allEnabledDeviceConfigs = oclocArgHelperWithoutInput->productConfigHelper->getDeviceAotInfo();
auto &allEnabledDeviceConfigs = oclocArgHelperWithoutInput->productConfigHelper->getDeviceAotInfo();
if (allEnabledDeviceConfigs.empty()) {
return;
}

View File

@ -47,7 +47,7 @@ bool requestedFatBinary(const std::vector<std::string> &args, OclocArgHelper *he
template <>
void getProductsAcronymsForTarget<AOT::FAMILY>(std::vector<NEO::ConstStringRef> &out, AOT::FAMILY target, OclocArgHelper *argHelper) {
auto allSuppportedProducts = argHelper->productConfigHelper->getDeviceAotInfo();
auto &allSuppportedProducts = argHelper->productConfigHelper->getDeviceAotInfo();
for (const auto &device : allSuppportedProducts) {
if (device.family == target && !device.acronyms.empty()) {
if (std::find(out.begin(), out.end(), device.acronyms.front()) == out.end()) {
@ -59,7 +59,7 @@ void getProductsAcronymsForTarget<AOT::FAMILY>(std::vector<NEO::ConstStringRef>
template <>
void getProductsAcronymsForTarget<AOT::RELEASE>(std::vector<NEO::ConstStringRef> &out, AOT::RELEASE target, OclocArgHelper *argHelper) {
auto allSuppportedProducts = argHelper->productConfigHelper->getDeviceAotInfo();
auto &allSuppportedProducts = argHelper->productConfigHelper->getDeviceAotInfo();
for (const auto &device : allSuppportedProducts) {
if (device.release == target && !device.acronyms.empty()) {
if (std::find(out.begin(), out.end(), device.acronyms.front()) == out.end()) {
@ -83,7 +83,7 @@ void getProductsForTargetRange(T targetFrom, T targetTo, std::vector<ConstString
void getProductsForRange(unsigned int productFrom, unsigned int productTo, std::vector<ConstStringRef> &out,
OclocArgHelper *argHelper) {
auto allSuppportedProducts = argHelper->productConfigHelper->getDeviceAotInfo();
auto &allSuppportedProducts = argHelper->productConfigHelper->getDeviceAotInfo();
for (const auto &device : allSuppportedProducts) {
auto validAcronym = device.aotConfig.ProductConfig >= productFrom;

View File

@ -158,7 +158,7 @@ int OfflineCompiler::queryAcronymIds(size_t numArgs, const std::vector<std::stri
std::string queryAcronym = allArgs[2];
ProductConfigHelper::adjustDeviceName(queryAcronym);
auto enabledDevices = helper->productConfigHelper->getDeviceAotInfo();
auto &enabledDevices = helper->productConfigHelper->getDeviceAotInfo();
std::vector<std::string> matchedVersions{};
if (helper->productConfigHelper->isFamily(queryAcronym)) {

View File

@ -25,7 +25,7 @@ struct PrepareDeviceEnvironmentsTest : ::testing::Test {
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
productConfigHelper = std::make_unique<ProductConfigHelper>();
auto aotInfos = productConfigHelper->getDeviceAotInfo();
auto &aotInfos = productConfigHelper->getDeviceAotInfo();
for (const auto &aotInfo : aotInfos) {
if (aotInfo.hwInfo->platform.eProductFamily == productFamily && !aotInfo.acronyms.empty()) {
deviceAot = aotInfo;

View File

@ -431,7 +431,7 @@ TEST_F(AotDeviceInfoTests, givenDeprecatedAcronymsWhenSearchingPresenceInNewName
}
TEST_F(AotDeviceInfoTests, givenNotFullConfigWhenGetProductConfigThenUnknownIsaIsReturned) {
auto allEnabledDeviceConfigs = productConfigHelper->getDeviceAotInfo();
auto &allEnabledDeviceConfigs = productConfigHelper->getDeviceAotInfo();
if (allEnabledDeviceConfigs.empty()) {
GTEST_SKIP();
}
@ -449,7 +449,7 @@ TEST_F(AotDeviceInfoTests, givenNotFullConfigWhenGetProductConfigThenUnknownIsaI
}
TEST_F(AotDeviceInfoTests, givenEnabledProductsAcronymsAndVersionsWhenCheckIfProductConfigThenTrueIsReturned) {
auto enabledProducts = productConfigHelper->getDeviceAotInfo();
auto &enabledProducts = productConfigHelper->getDeviceAotInfo();
for (const auto &product : enabledProducts) {
auto configStr = ProductConfigHelper::parseMajorMinorRevisionValue(product.aotConfig);
EXPECT_FALSE(configStr.empty());