refactor: Remove global CompilerProductHelper gettter 2/n

Related-To: NEO-6853
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2023-01-23 16:24:42 +00:00
committed by Compute-Runtime-Automation
parent 29012cb6ca
commit 3c6e7e12be
10 changed files with 30 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Intel Corporation
* Copyright (C) 2022-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -8,18 +8,19 @@
#include "addressing_mode_helper.h"
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/helpers/compiler_hw_info_config.h"
#include "shared/source/program/kernel_info.h"
namespace NEO::AddressingModeHelper {
bool failBuildProgramWithStatefulAccess(const HardwareInfo &hwInfo) {
bool failBuildProgramWithStatefulAccess(const RootDeviceEnvironment &rootDeviceEnvironment) {
auto failBuildProgram = false;
if (NEO::DebugManager.flags.FailBuildProgramWithStatefulAccess.get() != -1) {
failBuildProgram = static_cast<bool>(NEO::DebugManager.flags.FailBuildProgramWithStatefulAccess.get());
}
const auto &compilerProductHelper = *CompilerProductHelper::get(hwInfo.platform.eProductFamily);
const auto &compilerProductHelper = rootDeviceEnvironment.getHelper<CompilerProductHelper>();
auto forceToStatelessRequired = compilerProductHelper.isForceToStatelessRequired();
return failBuildProgram && forceToStatelessRequired;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Intel Corporation
* Copyright (C) 2022-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -10,10 +10,10 @@
namespace NEO {
struct KernelInfo;
struct HardwareInfo;
struct RootDeviceEnvironment;
namespace AddressingModeHelper {
bool failBuildProgramWithStatefulAccess(const HardwareInfo &hwInfo);
bool failBuildProgramWithStatefulAccess(const RootDeviceEnvironment &rootDeviceEnvironment);
bool containsStatefulAccess(const std::vector<KernelInfo *> &kernelInfos);
} // namespace AddressingModeHelper