mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-09 14:33:04 +08:00
Add debug flag to fail build program with stateful access
I've added debug flag FailBuildProgramWithStatefulAccess which makes possible to fail build program/module creation with stateful access(except builtins) on pvc and later platforms. Related-To: NEO-6075 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b24635b0c0
commit
99db73c034
@@ -8,6 +8,8 @@ set(NEO_CORE_HELPERS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/abort.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/address_patch.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/addressing_mode_helper.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/addressing_mode_helper.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/affinity_mask.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/aligned_memory.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/app_resource_defines.h
|
||||
|
||||
42
shared/source/helpers/addressing_mode_helper.cpp
Normal file
42
shared/source/helpers/addressing_mode_helper.cpp
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "addressing_mode_helper.h"
|
||||
|
||||
#include "shared/source/debug_settings/debug_settings_manager.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) {
|
||||
auto failBuildProgram = false;
|
||||
if (NEO::DebugManager.flags.FailBuildProgramWithStatefulAccess.get() != -1) {
|
||||
failBuildProgram = static_cast<bool>(NEO::DebugManager.flags.FailBuildProgramWithStatefulAccess.get());
|
||||
}
|
||||
|
||||
const auto &compilerHwInfoConfig = *CompilerHwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
auto forceToStatelessRequired = compilerHwInfoConfig.isForceToStatelessRequired();
|
||||
|
||||
return failBuildProgram && forceToStatelessRequired;
|
||||
}
|
||||
|
||||
bool containsStatefulAccess(const std::vector<KernelInfo *> &kernelInfos) {
|
||||
for (const auto &kernelInfo : kernelInfos) {
|
||||
for (const auto &arg : kernelInfo->kernelDescriptor.payloadMappings.explicitArgs) {
|
||||
auto isStatefulAccess = arg.is<NEO::ArgDescriptor::ArgTPointer>() &&
|
||||
(NEO::isValidOffset(arg.as<NEO::ArgDescPointer>().bindless) ||
|
||||
NEO::isValidOffset(arg.as<NEO::ArgDescPointer>().bindful));
|
||||
if (isStatefulAccess) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace NEO::AddressingModeHelper
|
||||
20
shared/source/helpers/addressing_mode_helper.h
Normal file
20
shared/source/helpers/addressing_mode_helper.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <vector>
|
||||
|
||||
namespace NEO {
|
||||
struct KernelInfo;
|
||||
struct HardwareInfo;
|
||||
|
||||
namespace AddressingModeHelper {
|
||||
bool failBuildProgramWithStatefulAccess(const HardwareInfo &hwInfo);
|
||||
bool containsStatefulAccess(const std::vector<KernelInfo *> &kernelInfos);
|
||||
|
||||
} // namespace AddressingModeHelper
|
||||
} // namespace NEO
|
||||
Reference in New Issue
Block a user