Create L0 debugger object

Related-To: NEO-4713

Change-Id: I9d10019bbe6e8514ce10bdd729a64ea233bf91b0
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2020-06-18 17:08:55 +02:00
committed by sys_ocldev
parent 3029db07c3
commit 68847ef942
26 changed files with 300 additions and 10 deletions

View File

@@ -13,6 +13,7 @@
#include "shared/source/os_interface/debug_env_reader.h"
#include "shared/source/os_interface/os_library.h"
#include "level_zero/core/source/debugger/debugger_l0.h"
#include "level_zero/core/source/device/device_imp.h"
#include "driver_version_l0.h"
@@ -108,6 +109,10 @@ ze_result_t DriverHandleImp::getMemAllocProperties(const void *ptr,
DriverHandleImp::~DriverHandleImp() {
for (auto &device : this->devices) {
if (device->getNEODevice()->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->debugger.get() &&
!device->getNEODevice()->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->debugger->isLegacy()) {
device->getNEODevice()->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->debugger.reset(nullptr);
}
delete device;
}
if (this->svmAllocsManager) {
@@ -149,6 +154,11 @@ ze_result_t DriverHandleImp::initialize(std::vector<std::unique_ptr<NEO::Device>
}
}
if (enableProgramDebugging) {
UNRECOVERABLE_IF(neoDevice->getDebugger() != nullptr && enableProgramDebugging);
neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[neoDevice->getRootDeviceIndex()]->debugger = DebuggerL0::create(neoDevice.get());
}
auto device = Device::create(this, neoDevice.release(), currentDeviceMask, false);
this->devices.push_back(device);
}