mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 07:14:10 +08:00
Create DebuggerL0 only when debugging is supported
Related-To: NEO-5239 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
8fdc35bb4b
commit
8aacad1854
@@ -81,7 +81,7 @@ class DebuggerL0 : public NEO::Debugger, NEO::NonCopyableOrMovableClass {
|
||||
sba.SurfaceStateBaseAddress != 0 ||
|
||||
sba.BindlessSurfaceStateBaseAddress != 0;
|
||||
}
|
||||
static void initDebuggingInOs(NEO::OSInterface *osInterface);
|
||||
static bool initDebuggingInOs(NEO::OSInterface *osInterface);
|
||||
|
||||
void initialize();
|
||||
|
||||
|
||||
@@ -13,10 +13,14 @@
|
||||
#include "level_zero/core/source/debugger/debugger_l0.h"
|
||||
|
||||
namespace L0 {
|
||||
void DebuggerL0::initDebuggingInOs(NEO::OSInterface *osInterface) {
|
||||
bool DebuggerL0::initDebuggingInOs(NEO::OSInterface *osInterface) {
|
||||
if (osInterface != nullptr) {
|
||||
auto drm = osInterface->get()->getDrm();
|
||||
drm->registerResourceClasses();
|
||||
if (drm->isVmBindAvailable() && drm->isPerContextVMRequired()) {
|
||||
drm->registerResourceClasses();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
} // namespace L0
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "level_zero/core/source/debugger/debugger_l0.h"
|
||||
|
||||
namespace L0 {
|
||||
void DebuggerL0::initDebuggingInOs(NEO::OSInterface *osInterface) {
|
||||
bool DebuggerL0::initDebuggingInOs(NEO::OSInterface *osInterface) {
|
||||
return false;
|
||||
}
|
||||
} // namespace L0
|
||||
@@ -13,9 +13,12 @@
|
||||
|
||||
namespace L0 {
|
||||
std::unique_ptr<NEO::Debugger> DebuggerL0::create(NEO::Device *device) {
|
||||
initDebuggingInOs(device->getRootDeviceEnvironment().osInterface.get());
|
||||
auto debugger = debuggerL0Factory[device->getHardwareInfo().platform.eRenderCoreFamily](device);
|
||||
return std::unique_ptr<DebuggerL0>(debugger);
|
||||
auto success = initDebuggingInOs(device->getRootDeviceEnvironment().osInterface.get());
|
||||
if (success) {
|
||||
auto debugger = debuggerL0Factory[device->getHardwareInfo().platform.eRenderCoreFamily](device);
|
||||
return std::unique_ptr<DebuggerL0>(debugger);
|
||||
}
|
||||
return std::unique_ptr<DebuggerL0>(nullptr);
|
||||
}
|
||||
|
||||
} // namespace L0
|
||||
@@ -46,7 +46,7 @@ void DriverImp::initialize(ze_result_t *result) {
|
||||
UNRECOVERABLE_IF(nullptr == executionEnvironment);
|
||||
|
||||
if (envVariables.programDebugging) {
|
||||
executionEnvironment->setPerContextMemorySpace();
|
||||
executionEnvironment->setDebuggingEnabled();
|
||||
}
|
||||
|
||||
executionEnvironment->incRefInternal();
|
||||
|
||||
Reference in New Issue
Block a user