Move CompilerProductHelper ownership to RootDeviceEnvironment and Ocloc

Related-To: NEO-6853
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2023-01-31 12:34:59 +00:00
committed by Compute-Runtime-Automation
parent 4eb443f4dc
commit 7487d1450e
14 changed files with 81 additions and 43 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -25,6 +25,7 @@ class MockOfflineCompiler : public OfflineCompiler {
using OfflineCompiler::appendExtraInternalOptions;
using OfflineCompiler::argHelper;
using OfflineCompiler::cache;
using OfflineCompiler::compilerProductHelper;
using OfflineCompiler::dbgHash;
using OfflineCompiler::debugDataBinary;
using OfflineCompiler::debugDataBinarySize;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -14,6 +14,7 @@
#include "shared/source/device_binary_format/ar/ar_decoder.h"
#include "shared/source/device_binary_format/elf/elf_decoder.h"
#include "shared/source/device_binary_format/elf/ocl_elf.h"
#include "shared/source/helpers/compiler_hw_info_config.h"
#include "shared/source/helpers/hw_helper.h"
#include "shared/source/helpers/product_config_helper.h"
@@ -146,8 +147,9 @@ TEST(OclocFatBinaryRequestedFatBinary, WhenDeviceArgMissingThenReturnsFalse) {
TEST(OclocFatBinaryRequestedFatBinary, givenHwInfoForProductConfigWhenUnknownIsaIsPassedThenFalseIsReturned) {
std::unique_ptr<OclocArgHelper> argHelper = std::make_unique<OclocArgHelper>();
std::unique_ptr<CompilerProductHelper> compilerProductHelper;
NEO::HardwareInfo hwInfo;
EXPECT_FALSE(argHelper->getHwInfoForProductConfig(AOT::UNKNOWN_ISA, hwInfo, 0u));
EXPECT_FALSE(argHelper->getHwInfoForProductConfig(AOT::UNKNOWN_ISA, hwInfo, 0u, std::move(compilerProductHelper)));
}
TEST(OclocFatBinaryRequestedFatBinary, givenReleaseOrFamilyAcronymWhenGetAcronymsForTargetThenCorrectValuesAreReturned) {

View File

@@ -3015,8 +3015,7 @@ struct OfflineCompilerStatelessToStatefulTests : public ::testing::Test {
};
TEST_F(OfflineCompilerStatelessToStatefulTests, whenAppendExtraInternalOptionsThenInternalOptionsAreCorrect) {
const auto &compilerProductHelper = *CompilerProductHelper::get(mockOfflineCompiler->hwInfo.platform.eProductFamily);
if (!compilerProductHelper.isForceToStatelessRequired()) {
if (!mockOfflineCompiler->compilerProductHelper->isForceToStatelessRequired()) {
GTEST_SKIP();
}
runTest();
@@ -3031,9 +3030,12 @@ class MockCompilerProductHelperHw : public CompilerProductHelperHw<productFamily
};
HWTEST2_F(OfflineCompilerStatelessToStatefulTests, givenMockWhenAppendExtraInternalOptionsThenInternalOptionsAreCorrect, MatchAny) {
MockCompilerProductHelperHw<productFamily> mockCompilerProductHelper;
VariableBackup<CompilerProductHelper *> backupMockProductHelper(&CompilerProductHelperFactory[productFamily], &mockCompilerProductHelper);
auto backup = std::unique_ptr<CompilerProductHelper>(new MockCompilerProductHelperHw<productFamily>());
this->mockOfflineCompiler->compilerProductHelper.swap(backup);
runTest();
this->mockOfflineCompiler->compilerProductHelper.swap(backup);
}
TEST(OfflineCompilerTest, givenNonExistingFilenameWhenUsedToReadOptionsThenReadOptionsFromFileReturnsFalse) {