2020-07-27 23:37:51 +08:00
|
|
|
/*
|
2024-06-20 19:56:15 +08:00
|
|
|
* Copyright (C) 2020-2024 Intel Corporation
|
2020-07-27 23:37:51 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-11-19 22:11:37 +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"
|
2022-07-05 23:55:15 +08:00
|
|
|
#include "shared/test/common/mocks/mock_l0_debugger.h"
|
2020-07-27 23:37:51 +08:00
|
|
|
|
2022-06-15 05:24:58 +08:00
|
|
|
NEO::DebugerL0CreateFn mockDebuggerL0HwFactory[IGFX_MAX_CORE];
|
2024-06-20 19:56:15 +08:00
|
|
|
bool forceCreateNullptrDebugger = false;
|
2024-07-05 11:26:37 +08:00
|
|
|
size_t createDebuggerCallCount = 0;
|
2022-06-15 05:24:58 +08:00
|
|
|
|
|
|
|
namespace NEO {
|
2020-07-27 23:37:51 +08:00
|
|
|
|
2022-06-15 05:24:58 +08:00
|
|
|
std::unique_ptr<Debugger> DebuggerL0::create(NEO::Device *device) {
|
2024-07-05 11:26:37 +08:00
|
|
|
createDebuggerCallCount++;
|
2024-06-20 19:56:15 +08:00
|
|
|
if (forceCreateNullptrDebugger) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
2020-11-19 22:11:37 +08:00
|
|
|
initDebuggingInOs(device->getRootDeviceEnvironment().osInterface.get());
|
2022-06-15 05:24:58 +08:00
|
|
|
auto debugger = mockDebuggerL0HwFactory[device->getHardwareInfo().platform.eRenderCoreFamily](device);
|
2020-09-14 19:28:47 +08:00
|
|
|
return std::unique_ptr<DebuggerL0>(debugger);
|
2020-07-27 23:37:51 +08:00
|
|
|
}
|
|
|
|
|
2022-06-15 05:24:58 +08:00
|
|
|
} // namespace NEO
|