mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 15:53:45 +08:00
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:
committed by
sys_ocldev
parent
3029db07c3
commit
68847ef942
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user