2020-06-18 17:08:55 +02:00
|
|
|
/*
|
2023-02-06 09:05:43 +00:00
|
|
|
* Copyright (C) 2020-2023 Intel Corporation
|
2020-06-18 17:08:55 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2022-06-14 21:24:58 +00:00
|
|
|
#include "shared/source/debugger/debugger_l0.h"
|
2020-11-19 14:11:37 +00:00
|
|
|
#include "shared/source/device/device.h"
|
2022-12-15 17:32:03 +00:00
|
|
|
#include "shared/source/execution_environment/root_device_environment.h"
|
2023-02-06 09:05:43 +00:00
|
|
|
#include "shared/source/helpers/hw_info.h"
|
2020-11-19 14:11:37 +00:00
|
|
|
#include "shared/source/os_interface/linux/drm_neo.h"
|
2021-05-21 01:17:57 +02:00
|
|
|
#include "shared/source/os_interface/os_interface.h"
|
2020-11-19 14:11:37 +00:00
|
|
|
|
2022-06-14 21:24:58 +00:00
|
|
|
namespace NEO {
|
2020-06-18 17:08:55 +02:00
|
|
|
std::unique_ptr<NEO::Debugger> DebuggerL0::create(NEO::Device *device) {
|
2022-02-18 17:01:54 +00:00
|
|
|
auto &hwInfo = device->getHardwareInfo();
|
|
|
|
|
if (!hwInfo.capabilityTable.l0DebuggerSupported) {
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
2020-11-23 14:31:20 +00:00
|
|
|
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);
|
2020-06-18 17:08:55 +02:00
|
|
|
}
|
2020-07-27 17:37:51 +02:00
|
|
|
|
2022-06-14 21:24:58 +00:00
|
|
|
} // namespace NEO
|