mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-07 04:48:08 +08:00
feature: Disable LevelZero debugging when experimental OpenCL enabled
- both drivers: OpenCL and LevelZero cannot be debugged within single process Related-To: NEO-7025 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
9b13f13e51
commit
7850d06c09
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2022 Intel Corporation
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -48,7 +48,9 @@ void DriverImp::initialize(ze_result_t *result) {
|
||||
UNRECOVERABLE_IF(nullptr == executionEnvironment);
|
||||
|
||||
if (envVariables.programDebugging) {
|
||||
executionEnvironment->setDebuggingEnabled();
|
||||
if (!NEO::DebugManager.flags.ExperimentalEnableL0DebuggerForOpenCL.get()) {
|
||||
executionEnvironment->setDebuggingEnabled();
|
||||
}
|
||||
}
|
||||
|
||||
executionEnvironment->incRefInternal();
|
||||
|
||||
@@ -391,6 +391,30 @@ TEST(DriverImpTest, givenEnabledProgramDebuggingWhenCreatingExecutionEnvironment
|
||||
L0::GlobalDriver = nullptr;
|
||||
}
|
||||
|
||||
TEST(DriverImpTest, givenEnabledProgramDebuggingAndEnabledExperimentalOpenCLWhenCreatingExecutionEnvironmentThenDebuggingEnabledIsFalse) {
|
||||
DebugManagerStateRestore restorer;
|
||||
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
|
||||
hwInfo.capabilityTable.levelZeroSupported = true;
|
||||
|
||||
NEO::DebugManager.flags.ExperimentalEnableL0DebuggerForOpenCL.set(true);
|
||||
|
||||
VariableBackup<uint32_t> mockGetenvCalledBackup(&IoFunctions::mockGetenvCalled, 0);
|
||||
std::unordered_map<std::string, std::string> mockableEnvs = {{"ZET_ENABLE_PROGRAM_DEBUGGING", "1"}};
|
||||
VariableBackup<std::unordered_map<std::string, std::string> *> mockableEnvValuesBackup(&IoFunctions::mockableEnvValues, &mockableEnvs);
|
||||
VariableBackup<decltype(L0::GlobalDriverHandle)> mockableDriverHandle(&L0::GlobalDriverHandle);
|
||||
VariableBackup<decltype(L0::GlobalDriver)> mockableDriver(&L0::GlobalDriver);
|
||||
|
||||
ze_result_t result = ZE_RESULT_ERROR_UNINITIALIZED;
|
||||
DriverImp driverImp;
|
||||
driverImp.initialize(&result);
|
||||
|
||||
ASSERT_NE(nullptr, L0::GlobalDriver);
|
||||
ASSERT_NE(0u, L0::GlobalDriver->numDevices);
|
||||
EXPECT_FALSE(L0::GlobalDriver->devices[0]->getNEODevice()->getExecutionEnvironment()->isDebuggingEnabled());
|
||||
|
||||
delete L0::GlobalDriver;
|
||||
}
|
||||
|
||||
TEST(DriverImpTest, givenNoProgramDebuggingEnvVarWhenCreatingExecutionEnvironmentThenDebuggingEnabledIsFalse) {
|
||||
|
||||
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
|
||||
|
||||
Reference in New Issue
Block a user