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