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) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -156,7 +156,7 @@ std::unique_ptr<char[]> OclocArgHelper::loadDataFromFile(const std::string &file
}
}
bool OclocArgHelper::getHwInfoForProductConfig(uint32_t productConfig, NEO::HardwareInfo &hwInfo, uint64_t hwInfoConfig) {
bool OclocArgHelper::getHwInfoForProductConfig(uint32_t productConfig, NEO::HardwareInfo &hwInfo, uint64_t hwInfoConfig, std::unique_ptr<NEO::CompilerProductHelper> &&compilerProductHelper) {
bool retVal = false;
if (productConfig == AOT::UNKNOWN_ISA) {
return retVal;
@@ -170,9 +170,9 @@ bool OclocArgHelper::getHwInfoForProductConfig(uint32_t productConfig, NEO::Hard
setHwInfoValuesFromConfig(hwInfoConfig, hwInfo);
}
NEO::hardwareInfoBaseSetup[hwInfo.platform.eProductFamily](&hwInfo, true);
const auto &compilerProductHelper = *NEO::CompilerProductHelper::get(hwInfo.platform.eProductFamily);
compilerProductHelper.setProductConfigForHwInfo(hwInfo, deviceConfig.aotConfig);
compilerProductHelper = NEO::CompilerProductHelper::create(hwInfo.platform.eProductFamily);
UNRECOVERABLE_IF(compilerProductHelper == nullptr);
compilerProductHelper->setProductConfigForHwInfo(hwInfo, deviceConfig.aotConfig);
hwInfo.platform.usDeviceID = deviceConfig.deviceIds->front();
retVal = true;