refactor: change debugging enabled to debugging mode

Related-To: NEO-7630

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2023-01-18 14:41:50 +00:00
committed by Compute-Runtime-Automation
parent db719b2acb
commit e62c5e25d5
29 changed files with 84 additions and 73 deletions

View File

@@ -34,7 +34,7 @@ void DriverImp::initialize(ze_result_t *result) {
envVariables.affinityMask =
envReader.getSetting("ZE_AFFINITY_MASK", std::string(""));
envVariables.programDebugging =
envReader.getSetting("ZET_ENABLE_PROGRAM_DEBUGGING", false);
envReader.getSetting("ZET_ENABLE_PROGRAM_DEBUGGING", 0);
envVariables.metrics =
envReader.getSetting("ZET_ENABLE_METRICS", false);
envVariables.pin =
@@ -51,7 +51,7 @@ void DriverImp::initialize(ze_result_t *result) {
if (envVariables.programDebugging) {
if (!NEO::DebugManager.flags.ExperimentalEnableL0DebuggerForOpenCL.get()) {
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
}
}

View File

@@ -188,7 +188,7 @@ void DriverHandleImp::updateRootDeviceBitFields(std::unique_ptr<NEO::Device> &ne
}
void DriverHandleImp::enableRootDeviceDebugger(std::unique_ptr<NEO::Device> &neoDevice) {
if (enableProgramDebugging) {
if (enableProgramDebugging != NEO::DebuggingMode::Disabled) {
const auto rootDeviceIndex = neoDevice->getRootDeviceIndex();
auto rootDeviceEnvironment = neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[rootDeviceIndex].get();
rootDeviceEnvironment->initDebuggerL0(neoDevice.get());
@@ -255,7 +255,7 @@ DriverHandle *DriverHandle::create(std::vector<std::unique_ptr<NEO::Device>> dev
DriverHandleImp *driverHandle = new DriverHandleImp;
UNRECOVERABLE_IF(nullptr == driverHandle);
driverHandle->enableProgramDebugging = envVariables.programDebugging;
driverHandle->enableProgramDebugging = static_cast<NEO::DebuggingMode>(envVariables.programDebugging);
driverHandle->enableSysman = envVariables.sysman;
driverHandle->enablePciIdDeviceOrder = envVariables.pciIdDeviceOrder;
ze_result_t res = driverHandle->initialize(std::move(devices));

View File

@@ -7,6 +7,7 @@
#pragma once
#include "shared/source/debugger/debugger.h"
#include "shared/source/memory_manager/graphics_allocation.h"
#include "level_zero/api/extensions/public/ze_exp_ext.h"
@@ -129,7 +130,7 @@ struct DriverHandleImp : public DriverHandle {
void enableRootDeviceDebugger(std::unique_ptr<NEO::Device> &neoDevice);
// Environment Variables
bool enableProgramDebugging = false;
NEO::DebuggingMode enableProgramDebugging = NEO::DebuggingMode::Disabled;
bool enableSysman = false;
bool enablePciIdDeviceOrder = false;
uint8_t powerHint = 0;

View File

@@ -27,7 +27,7 @@ class DriverImp : public Driver {
struct L0EnvVariables {
std::string affinityMask;
bool programDebugging;
uint32_t programDebugging;
bool metrics;
bool pin;
bool sysman;

View File

@@ -48,7 +48,7 @@ void AUBFixtureL0::setUp(const NEO::HardwareInfo *hardwareInfo, bool debuggingEn
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
if (debuggingEnabled) {
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
}
neoDevice = NEO::MockDevice::createWithExecutionEnvironment<NEO::MockDevice>(&hwInfo, executionEnvironment, 0u);
@@ -74,7 +74,7 @@ void AUBFixtureL0::setUp(const NEO::HardwareInfo *hardwareInfo, bool debuggingEn
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
driverHandle = std::make_unique<ult::Mock<DriverHandleImp>>();
driverHandle->enableProgramDebugging = debuggingEnabled;
driverHandle->enableProgramDebugging = debuggingEnabled ? NEO::DebuggingMode::Enabled : NEO::DebuggingMode::Disabled;
driverHandle->initialize(std::move(devices));

View File

@@ -49,7 +49,7 @@ struct ActiveDebuggerFixture {
debugger = new MockActiveSourceLevelDebugger(new MockOsLibrary);
executionEnvironment->rootDeviceEnvironments[0]->debugger.reset(debugger);
executionEnvironment->initializeMemoryManager();
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
device = NEO::MockDevice::create<NEO::MockDevice>(executionEnvironment, 0u);
device->setDebuggerActive(true);

View File

@@ -30,7 +30,7 @@ struct L0DebuggerFixture {
executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(mockBuiltIns);
memoryOperationsHandler = new NEO::MockMemoryOperations();
executionEnvironment->rootDeviceEnvironments[0]->memoryOperationsInterface.reset(memoryOperationsHandler);
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hwInfo);
hwInfo = *executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo();
@@ -50,7 +50,7 @@ struct L0DebuggerFixture {
NEO::DeviceVector devices;
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
driverHandle->enableProgramDebugging = true;
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Enabled;
driverHandle->initialize(std::move(devices));
device = driverHandle->devices[0];

View File

@@ -36,7 +36,7 @@ struct L0DebuggerLinuxFixture {
auto executionEnvironment = new NEO::ExecutionEnvironment();
auto mockBuiltIns = new NEO::MockBuiltins();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(mockBuiltIns);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(hwInfo ? hwInfo : defaultHwInfo.get());
executionEnvironment->initializeMemoryManager();
@@ -50,7 +50,7 @@ struct L0DebuggerLinuxFixture {
NEO::DeviceVector devices;
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
driverHandle->enableProgramDebugging = true;
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Enabled;
driverHandle->initialize(std::move(devices));
device = driverHandle->devices[0];
@@ -122,7 +122,7 @@ TEST_F(L0DebuggerLinuxTest, givenLinuxOSWhenL0DebuggerIsCreatedAddressModeIsNotS
TEST(L0DebuggerLinux, givenVmBindAndPerContextVmEnabledInDrmWhenInitializingDebuggingInOsThenRegisterResourceClassesIsCalled) {
auto executionEnvironment = std::make_unique<NEO::MockExecutionEnvironment>();
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->initializeMemoryManager();
auto osInterface = new OSInterface();
auto drmMock = new DrmMockResources(*executionEnvironment->rootDeviceEnvironments[0]);
@@ -141,7 +141,7 @@ TEST(L0DebuggerLinux, givenVmBindAndPerContextVmEnabledInDrmWhenInitializingDebu
TEST(L0DebuggerLinux, givenVmBindNotAvailableInDrmWhenInitializingDebuggingInOsThenRegisterResourceClassesIsNotCalled) {
auto executionEnvironment = std::make_unique<NEO::MockExecutionEnvironment>();
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->initializeMemoryManager();
auto osInterface = new OSInterface();
auto drmMock = new DrmMockResources(*executionEnvironment->rootDeviceEnvironments[0]);
@@ -160,7 +160,7 @@ TEST(L0DebuggerLinux, givenVmBindNotAvailableInDrmWhenInitializingDebuggingInOsT
TEST(L0DebuggerLinux, givenPerContextVmNotEnabledWhenInitializingDebuggingInOsThenRegisterResourceClassesIsNotCalled) {
auto executionEnvironment = std::make_unique<NEO::MockExecutionEnvironment>();
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->initializeMemoryManager();
auto osInterface = new OSInterface();
auto drmMock = new DrmMockResources(*executionEnvironment->rootDeviceEnvironments[0]);
@@ -413,7 +413,7 @@ HWTEST_F(L0DebuggerLinuxMultitileTest, givenSubDeviceFilteredByAffinityMaskWhenC
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->parseAffinityMask();
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(mockBuiltIns);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hwInfo);
executionEnvironment->initializeMemoryManager();
@@ -427,7 +427,7 @@ HWTEST_F(L0DebuggerLinuxMultitileTest, givenSubDeviceFilteredByAffinityMaskWhenC
NEO::DeviceVector devices;
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
auto driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
driverHandle->enableProgramDebugging = true;
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Enabled;
driverHandle->initialize(std::move(devices));
auto device = driverHandle->devices[0];

View File

@@ -74,12 +74,12 @@ TEST_F(L0DebuggerTest, givenL0DebuggerWhenGettingStateSaveAreaHeaderThenValidSip
}
TEST_F(L0DebuggerTest, givenProgramDebuggingEnabledWhenDebuggerIsCreatedThenFusedEusAreDisabled) {
EXPECT_TRUE(driverHandle->enableProgramDebugging);
EXPECT_TRUE(driverHandle->enableProgramDebugging == NEO::DebuggingMode::Enabled);
EXPECT_FALSE(neoDevice->getHardwareInfo().capabilityTable.fusedEuEnabled);
}
TEST_F(L0DebuggerTest, givenProgramDebuggingEnabledWhenDebuggerIsCreatedThenCompressionIsDisabled) {
EXPECT_TRUE(driverHandle->enableProgramDebugging);
EXPECT_TRUE(driverHandle->enableProgramDebugging == NEO::DebuggingMode::Enabled);
EXPECT_FALSE(neoDevice->getHardwareInfo().capabilityTable.ftrRenderCompressedBuffers);
EXPECT_FALSE(neoDevice->getHardwareInfo().capabilityTable.ftrRenderCompressedImages);
}

View File

@@ -437,7 +437,7 @@ HWTEST_F(ModuleWithDebuggerL0MultiTileTest, GivenSubDeviceWhenCreatingModuleThen
auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions();
neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip);
neoDevice->getExecutionEnvironment()->setDebuggingEnabled();
neoDevice->getExecutionEnvironment()->setDebuggingMode(NEO::DebuggingMode::Enabled);
neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->initDebuggerL0(neoDevice);
auto memoryOperationsHandler = new NEO::MockMemoryOperations();
neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->memoryOperationsInterface.reset(memoryOperationsHandler);

View File

@@ -295,14 +295,14 @@ TEST(Debugger, GivenLegacyDebuggerAndProgramDebuggingEnabledWhenInitializingDriv
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
executionEnvironment->initializeMemoryManager();
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
auto neoDevice = NEO::MockDevice::create<NEO::MockDevice>(executionEnvironment, 0u);
NEO::DeviceVector devices;
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
auto driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
driverHandle->enableProgramDebugging = true;
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Enabled;
EXPECT_THROW(driverHandle->initialize(std::move(devices)), std::exception);
std::string output = testing::internal::GetCapturedStderr();

View File

@@ -35,7 +35,7 @@ struct L0DebuggerWindowsFixture {
void setUp() {
executionEnvironment = new NEO::ExecutionEnvironment;
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
rootDeviceEnvironment = executionEnvironment->rootDeviceEnvironments[0].get();
auto osEnvironment = new OsEnvironmentWin();
gdi = new MockGdi();
@@ -56,7 +56,7 @@ struct L0DebuggerWindowsFixture {
NEO::DeviceVector devices;
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
driverHandle->enableProgramDebugging = true;
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Enabled;
driverHandle->initialize(std::move(devices));
device = driverHandle->devices[0];

View File

@@ -211,7 +211,7 @@ TEST(L0DeviceTest, givenDebuggerEnabledButIGCNotReturnsSSAHThenSSAHIsNotCopied)
NEO::DeviceVector devices;
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
auto driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
driverHandle->enableProgramDebugging = true;
driverHandle->enableProgramDebugging = NEO::DebuggingMode::Enabled;
driverHandle->initialize(std::move(devices));
auto sipType = SipKernel::getSipKernelType(*neoDevice);

View File

@@ -349,7 +349,7 @@ TEST(DriverTest, givenNullEnvVariableWhenCreatingDriverThenEnableProgramDebuggin
auto driverHandle = whiteboxCast(DriverHandle::create(std::move(devices), envVariables, &returnValue));
EXPECT_NE(nullptr, driverHandle);
EXPECT_FALSE(driverHandle->enableProgramDebugging);
EXPECT_EQ(NEO::DebuggingMode::Disabled, driverHandle->enableProgramDebugging);
delete driverHandle;
L0::GlobalDriver = nullptr;
@@ -499,7 +499,7 @@ TEST(DriverTest, givenProgramDebuggingEnvVarNonZeroWhenCreatingDriverThenEnableP
auto driverHandle = whiteboxCast(DriverHandle::create(std::move(devices), envVariables, &returnValue));
EXPECT_NE(nullptr, driverHandle);
EXPECT_TRUE(driverHandle->enableProgramDebugging);
EXPECT_TRUE(driverHandle->enableProgramDebugging == NEO::DebuggingMode::Enabled);
delete driverHandle;
L0::GlobalDriver = nullptr;

View File

@@ -89,9 +89,9 @@ cl_int CL_API_CALL clGetPlatformIDs(cl_uint numEntries,
NEO::EnvironmentVariableReader envReader;
if (NEO::DebugManager.flags.ExperimentalEnableL0DebuggerForOpenCL.get()) {
auto programDebugging = envReader.getSetting("ZET_ENABLE_PROGRAM_DEBUGGING", false);
if (programDebugging) {
executionEnvironment->setDebuggingEnabled();
auto programDebugging = envReader.getSetting("ZET_ENABLE_PROGRAM_DEBUGGING", 0);
if (programDebugging != 0) {
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
}
}
if (envReader.getSetting("NEO_FP64_EMULATION", false)) {

View File

@@ -30,7 +30,7 @@ struct DebuggerClFixture
void setUp() {
hardwareInfo = *NEO::defaultHwInfo.get();
auto executionEnvironment = MockClDevice::prepareExecutionEnvironment(&hardwareInfo, rootDeviceIndex);
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
device = MockDevice::createWithExecutionEnvironment<MockDevice>(&hardwareInfo, executionEnvironment, rootDeviceIndex);
ASSERT_NE(nullptr, device);
clExecutionEnvironment = static_cast<MockClExecutionEnvironment *>(device->getExecutionEnvironment());

View File

@@ -723,7 +723,7 @@ TEST_F(DrmTests, givenDebuggingEnabledWhenDrmIsCreatedThenPerContextVMIsTrueGetV
DebugManager.flags.CreateMultipleSubDevices.set(2);
DebugManager.flags.UseVmBind.set(1);
rootDeviceEnvironment->executionEnvironment.setDebuggingEnabled();
rootDeviceEnvironment->executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Enabled);
auto drm = DrmWrap::createDrm(*rootDeviceEnvironment);
ASSERT_NE(drm, nullptr);
@@ -748,7 +748,7 @@ TEST_F(DrmTests, givenEnabledDebuggingAndVmBindNotAvailableWhenDrmIsCreatedThenP
DebugManager.flags.UseVmBind.set(0);
DebugManager.flags.PrintDebugMessages.set(true);
rootDeviceEnvironment->executionEnvironment.setDebuggingEnabled();
rootDeviceEnvironment->executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Enabled);
auto drm = DrmWrap::createDrm(*rootDeviceEnvironment);
EXPECT_NE(drm, nullptr);

View File

@@ -443,7 +443,7 @@ TEST(PlatformInitTest, givenSingleDeviceWithNonZeroRootDeviceIndexInPassedDevice
TEST(PlatformInitTest, GivenDebuggingEnabledWhenPlatformIsInitializedThenL0DebuggerIsCreated) {
std::vector<std::unique_ptr<Device>> devices;
auto executionEnvironment = new MockExecutionEnvironment(defaultHwInfo.get(), false, 1);
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
devices.push_back(std::make_unique<MockDevice>(executionEnvironment, 0));
auto status = platform()->initialize(std::move(devices));
EXPECT_TRUE(status);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -44,5 +44,10 @@ class Debugger {
bool isLegacyMode = true;
};
enum class DebuggingMode : uint32_t {
Disabled,
Enabled
};
static_assert(std::is_standard_layout<Debugger::SbaAddresses>::value);
} // namespace NEO

View File

@@ -6,6 +6,7 @@
*/
#pragma once
#include "shared/source/debugger/debugger.h"
#include "shared/source/utilities/reference_tracked_object.h"
#include <unordered_map>
@@ -34,10 +35,10 @@ class ExecutionEnvironment : public ReferenceTrackedObject<ExecutionEnvironment>
void sortNeoDevicesDRM();
void sortNeoDevicesWDDM();
void prepareForCleanup() const;
void setDebuggingEnabled() {
debuggingEnabled = true;
void setDebuggingMode(DebuggingMode debuggingMode) {
debuggingEnabledMode = debuggingMode;
}
bool isDebuggingEnabled() { return debuggingEnabled; }
bool isDebuggingEnabled() { return debuggingEnabledMode != DebuggingMode::Disabled; }
void setMetricsEnabled(bool value) {
this->metricsEnabled = value;
}
@@ -46,6 +47,7 @@ class ExecutionEnvironment : public ReferenceTrackedObject<ExecutionEnvironment>
fp64EmulationEnabled = true;
}
bool isFP64EmulationEnabled() const { return fp64EmulationEnabled; }
DirectSubmissionController *initializeDirectSubmissionController();
std::unique_ptr<MemoryManager> memoryManager;
@@ -58,9 +60,10 @@ class ExecutionEnvironment : public ReferenceTrackedObject<ExecutionEnvironment>
void parseCcsCountLimitations();
void adjustCcsCountImpl(RootDeviceEnvironment *rootDeviceEnvironment) const;
void configureNeoEnvironment();
bool debuggingEnabled = false;
bool metricsEnabled = false;
bool fp64EmulationEnabled = false;
DebuggingMode debuggingEnabledMode = DebuggingMode::Disabled;
std::unordered_map<uint32_t, uint32_t> rootDeviceNumCcsMap;
};
} // namespace NEO

View File

@@ -28,7 +28,7 @@ struct L0DebuggerSharedLinuxFixture {
void setUp(HardwareInfo *hwInfo) {
auto executionEnvironment = new NEO::ExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(hwInfo ? hwInfo : defaultHwInfo.get());
executionEnvironment->initializeMemoryManager();
auto osInterface = new OSInterface();

View File

@@ -29,7 +29,7 @@ using namespace NEO;
TEST(Debugger, givenL0DebuggerWhenGettingL0DebuggerThenCorrectObjectIsReturned) {
auto executionEnvironment = new NEO::ExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
auto hwInfo = *NEO::defaultHwInfo.get();
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hwInfo);
@@ -48,7 +48,7 @@ TEST(Debugger, givenL0DebuggerWhenGettingL0DebuggerThenCorrectObjectIsReturned)
TEST(Debugger, givenSourceLevelDebuggerWhenGettingL0DebuggerThenNullptrIsReturned) {
auto executionEnvironment = new NEO::ExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
auto hwInfo = *NEO::defaultHwInfo.get();
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hwInfo);
@@ -102,7 +102,7 @@ TEST(Debugger, givenL0DebuggerOFFWhenGettingStateSaveAreaHeaderThenValidSipTypeI
TEST(Debugger, givenDebuggingEnabledInExecEnvWhenAllocatingIsaThenSingleBankIsUsed) {
auto executionEnvironment = new NEO::ExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
auto hwInfo = *NEO::defaultHwInfo.get();
hwInfo.featureTable.flags.ftrLocalMemory = true;
@@ -130,7 +130,7 @@ TEST(Debugger, givenTileAttachAndDebuggingEnabledInExecEnvWhenAllocatingIsaThenM
auto executionEnvironment = new NEO::ExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
auto hwInfo = *NEO::defaultHwInfo.get();
hwInfo.featureTable.flags.ftrLocalMemory = true;
@@ -162,7 +162,7 @@ TEST(Debugger, WhenInitializingDebuggerL0ThenCapabilitiesAreAdjustedAndDebuggerI
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
executionEnvironment->initializeMemoryManager();
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
auto neoDevice = std::unique_ptr<MockDevice>(MockDevice::create<MockDevice>(executionEnvironment, 0u));
@@ -193,7 +193,7 @@ TEST(Debugger, GivenLegacyDebuggerWhenInitializingDebuggerL0ThenAbortIsCalledAft
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
executionEnvironment->initializeMemoryManager();
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
auto neoDevice = std::unique_ptr<MockDevice>(MockDevice::create<MockDevice>(executionEnvironment, 0u));

View File

@@ -8,6 +8,7 @@
#include "shared/source/aub/aub_center.h"
#include "shared/source/built_ins/built_ins.h"
#include "shared/source/compiler_interface/compiler_interface.h"
#include "shared/source/debugger/debugger.h"
#include "shared/source/device/device.h"
#include "shared/source/direct_submission/direct_submission_controller.h"
#include "shared/source/execution_environment/execution_environment.h"
@@ -258,8 +259,9 @@ static_assert(sizeof(ExecutionEnvironment) == sizeof(std::unique_ptr<HardwareInf
sizeof(std::unique_ptr<OsEnvironment>) +
sizeof(std::unique_ptr<DirectSubmissionController>) +
sizeof(std::unordered_map<uint32_t, uint32_t>) +
sizeof(bool) +
(is64bit ? 23 : 15),
2 * sizeof(bool) +
sizeof(NEO::DebuggingMode) +
(is64bit ? 18 : 14),
"New members detected in ExecutionEnvironment, please ensure that destruction sequence of objects is correct");
TEST(ExecutionEnvironment, givenExecutionEnvironmentWithVariousMembersWhenItIsDestroyedThenDeleteSequenceIsSpecified) {

View File

@@ -367,7 +367,7 @@ TEST_F(DrmBufferObjectTest, givenDeleterWhenBufferObjectIsCreatedAndDeletedThenC
TEST(DrmBufferObject, givenPerContextVmRequiredWhenBoCreatedThenBindInfoIsInitializedToOsContextCount) {
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
device->getRootDeviceEnvironment().executionEnvironment.setDebuggingEnabled();
device->getRootDeviceEnvironment().executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Enabled);
device->getExecutionEnvironment()->calculateMaxOsContextCount();
DrmMock drm(*(device->getExecutionEnvironment()->rootDeviceEnvironments[0].get()));
EXPECT_TRUE(drm.isPerContextVMRequired());
@@ -385,7 +385,7 @@ TEST(DrmBufferObject, givenPerContextVmRequiredWhenBoCreatedThenBindInfoIsInitia
TEST(DrmBufferObject, givenDrmIoctlReturnsErrorNotSupportedThenBufferObjectReturnsError) {
auto executionEnvironment = new ExecutionEnvironment;
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
@@ -412,7 +412,7 @@ TEST(DrmBufferObject, givenDrmIoctlReturnsErrorNotSupportedThenBufferObjectRetur
TEST(DrmBufferObject, givenPerContextVmRequiredWhenBoBoundAndUnboundThenCorrectBindInfoIsUpdated) {
auto executionEnvironment = new ExecutionEnvironment;
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
@@ -455,7 +455,7 @@ TEST(DrmBufferObject, givenPrintBOBindingResultWhenBOBindAndUnbindSucceedsThenPr
DebugManager.flags.PrintBOBindingResult.set(true);
auto executionEnvironment = new ExecutionEnvironment;
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
@@ -508,7 +508,7 @@ TEST(DrmBufferObject, givenPrintBOBindingResultWhenBOBindAndUnbindFailsThenPrint
DebugManager.flags.PrintBOBindingResult.set(true);
auto executionEnvironment = new ExecutionEnvironment;
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();

View File

@@ -194,7 +194,7 @@ TEST_F(DrmDebugPrelimTest, GivenDrmWhenRegisteringElfResourceWithoutDataThenRegi
TEST(DrmPrelimTest, givenContextDebugAvailableWhenCheckedForSupportThenTrueIsReturned) {
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
@@ -218,7 +218,7 @@ TEST(DrmPrelimTest, givenContextDebugAvailableWhenCheckedForSupportThenTrueIsRet
TEST(DrmPrelimTest, givenContextDebugNotAvailableWhenCheckedForSupportThenTrueIsReturned) {
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
@@ -314,7 +314,7 @@ HWTEST_F(DrmDebugPrelimTest, givenAddedBindExtHandlesInBoWhenUnbindingThenExtens
TEST(DrmPrelimTest, givenProgramDebuggingAndContextDebugAvailableAndCCSEnginesWhenCreatingContextThenDebugFlagSipParamIsSet) {
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
@@ -336,7 +336,7 @@ TEST(DrmPrelimTest, givenProgramDebuggingAndContextDebugAvailableAndCCSEnginesWh
TEST(DrmPrelimTest, givenProgramDebuggingAndContextDebugAvailableAndCCSEnginesWhenCreatingContextThenContextRunaloneIsSetOnlyIfCCSEnginesArePresent) {
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();

View File

@@ -302,7 +302,7 @@ TEST(DrmBufferObjectTestPrelim, givenDebuggingEnabledWithoutDisableScratchPagesF
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
uint32_t vmId = 0;
drm.createDrmVirtualMemory(vmId);
@@ -317,7 +317,7 @@ TEST(DrmBufferObjectTestPrelim, givenDisableScratchPagesAndDebuggingEnabledWhenC
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
uint32_t vmId = 0;
drm.createDrmVirtualMemory(vmId);

View File

@@ -669,7 +669,7 @@ TEST(DrmTest, givenDrmWhenCreatingOsContextThenCreateDrmContextWithVmId) {
TEST(DrmTest, givenDrmWithPerContextVMRequiredWhenCreatingOsContextsThenImplicitVmIdPerContextIsUsed) {
MockExecutionEnvironment executionEnvironment{};
auto &rootEnv = *executionEnvironment.rootDeviceEnvironments[0];
rootEnv.executionEnvironment.setDebuggingEnabled();
rootEnv.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Enabled);
DrmMock drmMock(rootEnv);
EXPECT_TRUE(drmMock.requirePerContextVM);
@@ -684,7 +684,7 @@ TEST(DrmTest, givenDrmWithPerContextVMRequiredWhenCreatingOsContextsThenImplicit
TEST(DrmTest, givenPerContextVMRequiredWhenCreatingOsContextsThenImplicitVmIdPerContextIsQueriedAndStored) {
MockExecutionEnvironment executionEnvironment{};
auto &rootEnv = *executionEnvironment.rootDeviceEnvironments[0];
rootEnv.executionEnvironment.setDebuggingEnabled();
rootEnv.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Enabled);
DrmMock drmMock(rootEnv);
EXPECT_TRUE(drmMock.requirePerContextVM);
@@ -704,7 +704,7 @@ TEST(DrmTest, givenPerContextVMRequiredWhenCreatingOsContextsThenImplicitVmIdPer
TEST(DrmTest, givenPerContextVMRequiredWhenCreatingOsContextForSubDeviceThenImplicitVmIdPerContextIsQueriedAndStoredAtSubDeviceIndex) {
MockExecutionEnvironment executionEnvironment{};
auto &rootEnv = *executionEnvironment.rootDeviceEnvironments[0];
rootEnv.executionEnvironment.setDebuggingEnabled();
rootEnv.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Enabled);
DrmMock drmMock(rootEnv);
EXPECT_TRUE(drmMock.requirePerContextVM);
@@ -728,7 +728,7 @@ TEST(DrmTest, givenPerContextVMRequiredWhenCreatingOsContextForSubDeviceThenImpl
TEST(DrmTest, givenPerContextVMRequiredWhenCreatingOsContextsForRootDeviceThenImplicitVmIdsPerContextAreQueriedAndStoredAtSubDeviceIndices) {
MockExecutionEnvironment executionEnvironment{};
auto &rootEnv = *executionEnvironment.rootDeviceEnvironments[0];
rootEnv.executionEnvironment.setDebuggingEnabled();
rootEnv.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Enabled);
DrmMock drmMock(rootEnv);
EXPECT_TRUE(drmMock.requirePerContextVM);
@@ -769,7 +769,7 @@ TEST(DrmTest, givenNoPerContextVmsDrmWhenCreatingOsContextsThenVmIdIsNotQueriedA
TEST(DrmTest, givenProgramDebuggingAndContextDebugAvailableWhenCreatingContextThenSetContextDebugFlagIsCalled) {
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
@@ -789,7 +789,7 @@ TEST(DrmTest, givenProgramDebuggingAndContextDebugAvailableWhenCreatingContextTh
TEST(DrmTest, givenProgramDebuggingAndContextDebugAvailableWhenCreatingContextForInternalEngineThenSetContextDebugFlagIsNotCalled) {
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
@@ -825,7 +825,7 @@ TEST(DrmTest, givenNotEnabledDebuggingOrContextDebugUnsupportedWhenCreatingConte
EXPECT_FALSE(drmMock.capturedCooperativeContextRequest);
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
drmMock.contextDebugSupported = false;
drmMock.callBaseCreateDrmContext = false;
drmMock.capturedCooperativeContextRequest = true;
@@ -881,7 +881,7 @@ TEST(DrmTest, givenPrintIoctlDebugFlagNotSetWhenGettingTimestampFrequencyThenCap
TEST(DrmTest, givenProgramDebuggingWhenCreatingContextThenUnrecoverableContextIsSet) {
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();

View File

@@ -496,7 +496,7 @@ TEST_F(IoctlHelperPrelimFixture, whenCreateDrmContextIsCalledThenIoctlIsCalledOn
}
TEST_F(IoctlHelperPrelimFixture, givenProgramDebuggingAndContextDebugSupportedWhenCreatingContextThenCooperativeFlagIsPassedToCreateDrmContextOnlyIfCCSEnginesArePresent) {
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
drm->contextDebugSupported = true;
drm->callBaseCreateDrmContext = false;

View File

@@ -87,7 +87,7 @@ TEST_F(WddmTests, whenftrEuDebugIsFalseThenDebuggingEnabledReturnsFalse) {
}
TEST_F(WddmTests, whenProgramDebugIsEnabledAndCreatingContextWithInternalEngineThenDebuggableContextReturnsFalse) {
executionEnvironment->setDebuggingEnabled();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::Enabled);
wddm->init();
OsContextWin osContext(*wddm, 0, 5u, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::EngineType::ENGINE_RCS, EngineUsage::Internal}));
osContext.ensureContextInitialized();
@@ -171,7 +171,7 @@ TEST_F(WddmTests, GivengtSystemInfoSliceInfoHasEnabledSlicesAtHigherIndicesThenE
&hwInfo->gtSystemInfo,
hwInfo->capabilityTable.gpuAddressSpace));
wddm->rootDeviceEnvironment.executionEnvironment.setDebuggingEnabled();
wddm->rootDeviceEnvironment.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Enabled);
EXPECT_TRUE(wddm->init());
const auto &topologyMap = wddm->getTopologyMap();
EXPECT_EQ(topologyMap.size(), 1u);
@@ -196,7 +196,7 @@ TEST_F(WddmTests, GivenProperTopologyDataAndDebugFlagsEnabledWhenInitializingWdd
&hwInfo->gtSystemInfo,
hwInfo->capabilityTable.gpuAddressSpace));
wddm->rootDeviceEnvironment.executionEnvironment.setDebuggingEnabled();
wddm->rootDeviceEnvironment.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Enabled);
EXPECT_TRUE(wddm->init());
const auto &topologyMap = wddm->getTopologyMap();
EXPECT_EQ(topologyMap.size(), 1u);
@@ -217,7 +217,7 @@ TEST_F(WddmTests, GivenNoSubsliceEnabledAndDebugFlagsEnabledWhenInitializingWddm
&hwInfo->gtSystemInfo,
hwInfo->capabilityTable.gpuAddressSpace));
wddm->rootDeviceEnvironment.executionEnvironment.setDebuggingEnabled();
wddm->rootDeviceEnvironment.executionEnvironment.setDebuggingMode(NEO::DebuggingMode::Enabled);
EXPECT_FALSE(wddm->init());
const auto &topologyMap = wddm->getTopologyMap();
EXPECT_TRUE(topologyMap.empty());