diff --git a/level_zero/CMakeLists.txt b/level_zero/CMakeLists.txt index 59228574ce..29f18d005e 100644 --- a/level_zero/CMakeLists.txt +++ b/level_zero/CMakeLists.txt @@ -237,6 +237,7 @@ if(BUILD_WITH_L0) if(WIN32) target_sources(${TARGET_NAME_L0} PRIVATE + ${NEO_SHARED_DIRECTORY}/dll/windows/debugger_l0_windows.cpp ${NEO_SHARED_DIRECTORY}/dll/windows/environment_variables.cpp ${NEO_SHARED_DIRECTORY}/dll/windows/options_windows.cpp ${NEO_SHARED_DIRECTORY}/dll/windows/os_interface.cpp @@ -262,6 +263,7 @@ if(BUILD_WITH_L0) ${NEO_SHARED_DIRECTORY}/dll/devices${BRANCH_DIR_SUFFIX}devices.inl ${NEO_SHARED_DIRECTORY}/dll/devices${BRANCH_DIR_SUFFIX}devices_additional.inl ${NEO_SHARED_DIRECTORY}/dll/devices/devices_base.inl + ${NEO_SHARED_DIRECTORY}/dll/linux/debugger_l0_dll_linux.cpp ${NEO_SHARED_DIRECTORY}/dll/linux/drm_neo_create.cpp ${NEO_SHARED_DIRECTORY}/dll/linux/options_linux.cpp ${NEO_SHARED_DIRECTORY}/dll/linux/os_interface.cpp @@ -374,7 +376,6 @@ if(BUILD_WITH_L0) L0_SOURCES_WINDOWS L0_SRCS_CACHE_RESERVATION L0_SRCS_COMPILER_INTERFACE - L0_SRCS_DEBUGGER L0_SRCS_DRIVER L0_SRCS_OCLOC_SHARED ) diff --git a/level_zero/core/source/debugger/CMakeLists.txt b/level_zero/core/source/debugger/CMakeLists.txt deleted file mode 100644 index e12b02110f..0000000000 --- a/level_zero/core/source/debugger/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright (C) 2020-2022 Intel Corporation -# -# SPDX-License-Identifier: MIT -# - -set(L0_SRCS_DEBUGGER - ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt - ${CMAKE_CURRENT_SOURCE_DIR}/debugger_l0.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/debugger_l0.h - ${CMAKE_CURRENT_SOURCE_DIR}/debugger_l0.inl - ${CMAKE_CURRENT_SOURCE_DIR}/debugger_l0_base.inl - ${CMAKE_CURRENT_SOURCE_DIR}/debugger_l0_tgllp_and_later.inl -) - -add_subdirectories() -set_property(GLOBAL PROPERTY L0_SRCS_DEBUGGER ${L0_SRCS_DEBUGGER}) diff --git a/level_zero/core/source/device/device.h b/level_zero/core/source/device/device.h index 088f5854f3..bd6bd8a2ff 100644 --- a/level_zero/core/source/device/device.h +++ b/level_zero/core/source/device/device.h @@ -7,7 +7,8 @@ #pragma once -#include "level_zero/core/source/debugger/debugger_l0.h" +#include "shared/source/debugger/debugger_l0.h" + #include #include @@ -115,10 +116,10 @@ struct Device : _ze_device_handle_t { virtual NEO::PreemptionMode getDevicePreemptionMode() const = 0; virtual const NEO::DeviceInfo &getDeviceInfo() const = 0; NEO::SourceLevelDebugger *getSourceLevelDebugger() { return getNEODevice()->getSourceLevelDebugger(); } - DebuggerL0 *getL0Debugger() { + NEO::DebuggerL0 *getL0Debugger() { auto debugger = getNEODevice()->getDebugger(); if (debugger) { - return !debugger->isLegacy() ? static_cast(debugger) : nullptr; + return !debugger->isLegacy() ? static_cast(debugger) : nullptr; } return nullptr; } diff --git a/level_zero/core/source/dll/linux/CMakeLists.txt b/level_zero/core/source/dll/linux/CMakeLists.txt index 6d5d5f6176..08cbc74b95 100644 --- a/level_zero/core/source/dll/linux/CMakeLists.txt +++ b/level_zero/core/source/dll/linux/CMakeLists.txt @@ -6,7 +6,6 @@ set(L0_SRCS_DLL_LINUX ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt - ${CMAKE_CURRENT_SOURCE_DIR}/debugger_l0_linux.cpp ) if(NEO_ENABLE_i915_PRELIM_DETECTION) diff --git a/level_zero/core/source/dll/windows/CMakeLists.txt b/level_zero/core/source/dll/windows/CMakeLists.txt index 7130e200a9..c2242f7ba0 100644 --- a/level_zero/core/source/dll/windows/CMakeLists.txt +++ b/level_zero/core/source/dll/windows/CMakeLists.txt @@ -6,7 +6,6 @@ set(L0_SRCS_DLL_WINDOWS ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt - ${CMAKE_CURRENT_SOURCE_DIR}/debugger_l0_windows.cpp ${NEO_SOURCE_DIR}/level_zero/tools/source/debug/windows/debug_session_windows_helper.cpp ) diff --git a/level_zero/core/source/driver/driver_handle_imp.cpp b/level_zero/core/source/driver/driver_handle_imp.cpp index 076de610f8..ae7de2c899 100644 --- a/level_zero/core/source/driver/driver_handle_imp.cpp +++ b/level_zero/core/source/driver/driver_handle_imp.cpp @@ -8,6 +8,7 @@ #include "level_zero/core/source/driver/driver_handle_imp.h" #include "shared/source/debug_settings/debug_settings_manager.h" +#include "shared/source/debugger/debugger_l0.h" #include "shared/source/device/device.h" #include "shared/source/helpers/string.h" #include "shared/source/memory_manager/memory_manager.h" @@ -15,7 +16,6 @@ #include "shared/source/os_interface/os_library.h" #include "level_zero/core/source/context/context_imp.h" -#include "level_zero/core/source/debugger/debugger_l0.h" #include "level_zero/core/source/device/device_imp.h" #include "level_zero/core/source/driver/driver_imp.h" #include "level_zero/core/source/driver/host_pointer_manager.h" @@ -181,7 +181,7 @@ void DriverHandleImp::enableRootDeviceDebugger(std::unique_ptr &neo rootDeviceEnvironment->getMutableHardwareInfo()->capabilityTable.ftrRenderCompressedBuffers = false; rootDeviceEnvironment->getMutableHardwareInfo()->capabilityTable.ftrRenderCompressedImages = false; - rootDeviceEnvironment->debugger = DebuggerL0::create(neoDevice.get()); + rootDeviceEnvironment->debugger = NEO::DebuggerL0::create(neoDevice.get()); } } diff --git a/level_zero/core/source/gen11/CMakeLists.txt b/level_zero/core/source/gen11/CMakeLists.txt index 0a8f086543..4454c84b85 100644 --- a/level_zero/core/source/gen11/CMakeLists.txt +++ b/level_zero/core/source/gen11/CMakeLists.txt @@ -9,7 +9,6 @@ if(SUPPORT_GEN11) ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_gen11.cpp ${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_gen11.h - ${CMAKE_CURRENT_SOURCE_DIR}/debugger_gen11.cpp ${CMAKE_CURRENT_SOURCE_DIR}/enable_family_full_l0_gen11.cpp ${CMAKE_CURRENT_SOURCE_DIR}/l0_hw_helper_gen11.cpp ) diff --git a/level_zero/core/source/gen11/debugger_gen11.cpp b/level_zero/core/source/gen11/debugger_gen11.cpp deleted file mode 100644 index 576a2ee8d6..0000000000 --- a/level_zero/core/source/gen11/debugger_gen11.cpp +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2020-2022 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "level_zero/core/source/debugger/debugger_l0.inl" -#include "level_zero/core/source/debugger/debugger_l0_base.inl" - -namespace NEO { -struct ICLFamily; -using GfxFamily = ICLFamily; -} // namespace NEO - -namespace L0 { -template class DebuggerL0Hw; -static DebuggerL0PopulateFactory debuggerGen11; -} // namespace L0 \ No newline at end of file diff --git a/level_zero/core/source/gen12lp/CMakeLists.txt b/level_zero/core/source/gen12lp/CMakeLists.txt index 1e7fb4a060..bf5e905364 100644 --- a/level_zero/core/source/gen12lp/CMakeLists.txt +++ b/level_zero/core/source/gen12lp/CMakeLists.txt @@ -9,7 +9,6 @@ if(SUPPORT_GEN12LP) ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_gen12lp.cpp ${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_gen12lp.h - ${CMAKE_CURRENT_SOURCE_DIR}/debugger_gen12lp.cpp ${CMAKE_CURRENT_SOURCE_DIR}/definitions/cache_flush_gen12lp.inl ${CMAKE_CURRENT_SOURCE_DIR}/enable_family_full_l0_gen12lp.cpp ${CMAKE_CURRENT_SOURCE_DIR}/l0_hw_helper_gen12lp.cpp diff --git a/level_zero/core/source/gen12lp/debugger_gen12lp.cpp b/level_zero/core/source/gen12lp/debugger_gen12lp.cpp deleted file mode 100644 index b9a0b413d3..0000000000 --- a/level_zero/core/source/gen12lp/debugger_gen12lp.cpp +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (C) 2020-2022 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "level_zero/core/source/debugger/debugger_l0.inl" -#include "level_zero/core/source/debugger/debugger_l0_tgllp_and_later.inl" -namespace L0 { - -using Family = NEO::TGLLPFamily; - -template class DebuggerL0Hw; -static DebuggerL0PopulateFactory debuggerGen12lp; - -} // namespace L0 \ No newline at end of file diff --git a/level_zero/core/source/gen8/CMakeLists.txt b/level_zero/core/source/gen8/CMakeLists.txt index cdfa5033b3..e32acd0e42 100644 --- a/level_zero/core/source/gen8/CMakeLists.txt +++ b/level_zero/core/source/gen8/CMakeLists.txt @@ -7,7 +7,6 @@ if(SUPPORT_GEN8) set(HW_SOURCES_GEN8 ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt - ${CMAKE_CURRENT_SOURCE_DIR}/debugger_gen8.cpp ${CMAKE_CURRENT_SOURCE_DIR}/enable_family_full_l0_gen8.cpp ) diff --git a/level_zero/core/source/gen8/debugger_gen8.cpp b/level_zero/core/source/gen8/debugger_gen8.cpp deleted file mode 100644 index e9099217c6..0000000000 --- a/level_zero/core/source/gen8/debugger_gen8.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2020-2022 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "level_zero/core/source/debugger/debugger_l0.inl" -#include "level_zero/core/source/debugger/debugger_l0_base.inl" - -namespace NEO { - -struct BDWFamily; -using GfxFamily = BDWFamily; - -} // namespace NEO - -namespace L0 { -template class DebuggerL0Hw; -} // namespace L0 \ No newline at end of file diff --git a/level_zero/core/source/gen9/CMakeLists.txt b/level_zero/core/source/gen9/CMakeLists.txt index 12eecc69bc..20f7a3e64c 100644 --- a/level_zero/core/source/gen9/CMakeLists.txt +++ b/level_zero/core/source/gen9/CMakeLists.txt @@ -9,7 +9,6 @@ if(SUPPORT_GEN9) ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_gen9.cpp ${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_gen9.h - ${CMAKE_CURRENT_SOURCE_DIR}/debugger_gen9.cpp ${CMAKE_CURRENT_SOURCE_DIR}/enable_family_full_l0_gen9.cpp ${CMAKE_CURRENT_SOURCE_DIR}/l0_hw_helper_gen9.cpp ) diff --git a/level_zero/core/source/gen9/debugger_gen9.cpp b/level_zero/core/source/gen9/debugger_gen9.cpp deleted file mode 100644 index 1e5103b5b4..0000000000 --- a/level_zero/core/source/gen9/debugger_gen9.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2020-2022 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "level_zero/core/source/debugger/debugger_l0.inl" -#include "level_zero/core/source/debugger/debugger_l0_base.inl" - -namespace NEO { -struct SKLFamily; -using GfxFamily = SKLFamily; -} // namespace NEO - -namespace L0 { - -template class DebuggerL0Hw; -static DebuggerL0PopulateFactory debuggerGen9; -} // namespace L0 \ No newline at end of file diff --git a/level_zero/core/source/kernel/kernel_imp.cpp b/level_zero/core/source/kernel/kernel_imp.cpp index 55399b794d..d87600d1ca 100644 --- a/level_zero/core/source/kernel/kernel_imp.cpp +++ b/level_zero/core/source/kernel/kernel_imp.cpp @@ -7,6 +7,7 @@ #include "level_zero/core/source/kernel/kernel_imp.h" +#include "shared/source/debugger/debugger_l0.h" #include "shared/source/helpers/basic_math.h" #include "shared/source/helpers/blit_commands_helper.h" #include "shared/source/helpers/hw_info.h" @@ -26,7 +27,6 @@ #include "shared/source/program/kernel_info.h" #include "shared/source/utilities/arrayref.h" -#include "level_zero/core/source/debugger/debugger_l0.h" #include "level_zero/core/source/device/device.h" #include "level_zero/core/source/device/device_imp.h" #include "level_zero/core/source/driver/driver_handle_imp.h" diff --git a/level_zero/core/source/xe_hp_core/CMakeLists.txt b/level_zero/core/source/xe_hp_core/CMakeLists.txt index dcbc395536..77b1bf934b 100644 --- a/level_zero/core/source/xe_hp_core/CMakeLists.txt +++ b/level_zero/core/source/xe_hp_core/CMakeLists.txt @@ -9,7 +9,6 @@ if(SUPPORT_XE_HP_CORE) ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_xe_hp_core.cpp ${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_xe_hp_core.h - ${CMAKE_CURRENT_SOURCE_DIR}/debugger_xe_hp_core.cpp ${CMAKE_CURRENT_SOURCE_DIR}/image_xe_hp_core.inl ${CMAKE_CURRENT_SOURCE_DIR}/sampler_xe_hp_core.inl ${CMAKE_CURRENT_SOURCE_DIR}/enable_family_full_l0_xe_hp_core.cpp diff --git a/level_zero/core/source/xe_hp_core/debugger_xe_hp_core.cpp b/level_zero/core/source/xe_hp_core/debugger_xe_hp_core.cpp deleted file mode 100644 index 2730f47625..0000000000 --- a/level_zero/core/source/xe_hp_core/debugger_xe_hp_core.cpp +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (C) 2021-2022 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "level_zero/core/source/debugger/debugger_l0.inl" -#include "level_zero/core/source/debugger/debugger_l0_tgllp_and_later.inl" -namespace L0 { - -using Family = NEO::XeHpFamily; - -DebuggerL0PopulateFactory debuggerXE_HP_CORE; - -template class DebuggerL0Hw; - -} // namespace L0 diff --git a/level_zero/core/source/xe_hpc_core/CMakeLists.txt b/level_zero/core/source/xe_hpc_core/CMakeLists.txt index b1aab4868c..6ce22d511d 100644 --- a/level_zero/core/source/xe_hpc_core/CMakeLists.txt +++ b/level_zero/core/source/xe_hpc_core/CMakeLists.txt @@ -9,7 +9,6 @@ if(SUPPORT_XE_HPC_CORE) ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_xe_hpc_core.cpp ${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_xe_hpc_core.h - ${CMAKE_CURRENT_SOURCE_DIR}/debugger_xe_hpc_core.cpp ${CMAKE_CURRENT_SOURCE_DIR}/enable_family_full_l0_xe_hpc_core.cpp ${CMAKE_CURRENT_SOURCE_DIR}/l0_hw_helper_xe_hpc_core.cpp ) diff --git a/level_zero/core/source/xe_hpc_core/debugger_xe_hpc_core.cpp b/level_zero/core/source/xe_hpc_core/debugger_xe_hpc_core.cpp deleted file mode 100644 index de19c9f21b..0000000000 --- a/level_zero/core/source/xe_hpc_core/debugger_xe_hpc_core.cpp +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (C) 2021-2022 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "level_zero/core/source/debugger/debugger_l0.inl" -#include "level_zero/core/source/debugger/debugger_l0_tgllp_and_later.inl" -namespace L0 { - -using Family = NEO::XE_HPC_COREFamily; - -template class DebuggerL0Hw; -static DebuggerL0PopulateFactory debuggerXeHpcCore; -} // namespace L0 \ No newline at end of file diff --git a/level_zero/core/source/xe_hpg_core/CMakeLists.txt b/level_zero/core/source/xe_hpg_core/CMakeLists.txt index ec56e04713..f743f11f05 100644 --- a/level_zero/core/source/xe_hpg_core/CMakeLists.txt +++ b/level_zero/core/source/xe_hpg_core/CMakeLists.txt @@ -9,7 +9,6 @@ if(SUPPORT_XE_HPG_CORE) ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_xe_hpg_core.cpp ${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_xe_hpg_core.h - ${CMAKE_CURRENT_SOURCE_DIR}/debugger_xe_hpg_core.cpp ${CMAKE_CURRENT_SOURCE_DIR}/image_xe_hpg_core.inl ${CMAKE_CURRENT_SOURCE_DIR}/sampler_xe_hpg_core.inl ${CMAKE_CURRENT_SOURCE_DIR}/enable_family_full_l0_xe_hpg_core.cpp diff --git a/level_zero/core/source/xe_hpg_core/debugger_xe_hpg_core.cpp b/level_zero/core/source/xe_hpg_core/debugger_xe_hpg_core.cpp deleted file mode 100644 index 99b1d16102..0000000000 --- a/level_zero/core/source/xe_hpg_core/debugger_xe_hpg_core.cpp +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (C) 2021-2022 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "level_zero/core/source/debugger/debugger_l0.inl" -#include "level_zero/core/source/debugger/debugger_l0_tgllp_and_later.inl" -namespace L0 { - -using Family = NEO::XE_HPG_COREFamily; - -template class DebuggerL0Hw; -static DebuggerL0PopulateFactory debuggerXeHpgCore; -} // namespace L0 \ No newline at end of file diff --git a/level_zero/core/test/aub_tests/debugger/debugger_aub_tests.cpp b/level_zero/core/test/aub_tests/debugger/debugger_aub_tests.cpp index 9a9fcf021b..5556578039 100644 --- a/level_zero/core/test/aub_tests/debugger/debugger_aub_tests.cpp +++ b/level_zero/core/test/aub_tests/debugger/debugger_aub_tests.cpp @@ -133,16 +133,16 @@ HWTEST2_F(DebuggerSingleAddressSpaceAub, GivenSingleAddressSpaceWhenCmdListIsExe auto dynamicStateBaseAddress = commandList->commandContainer.getIndirectHeap(HeapType::DYNAMIC_STATE)->getGraphicsAllocation()->getGpuAddress(); auto surfaceStateBaseAddress = commandList->commandContainer.getIndirectHeap(HeapType::SURFACE_STATE)->getGraphicsAllocation()->getGpuAddress(); - expectMemory(reinterpret_cast(sbaAddress + offsetof(SbaTrackedAddresses, SurfaceStateBaseAddress)), + expectMemory(reinterpret_cast(sbaAddress + offsetof(NEO::SbaTrackedAddresses, SurfaceStateBaseAddress)), &surfaceStateBaseAddress, sizeof(surfaceStateBaseAddress)); - expectMemory(reinterpret_cast(sbaAddress + offsetof(SbaTrackedAddresses, DynamicStateBaseAddress)), + expectMemory(reinterpret_cast(sbaAddress + offsetof(NEO::SbaTrackedAddresses, DynamicStateBaseAddress)), &dynamicStateBaseAddress, sizeof(dynamicStateBaseAddress)); - expectMemory(reinterpret_cast(sbaAddress + offsetof(SbaTrackedAddresses, InstructionBaseAddress)), + expectMemory(reinterpret_cast(sbaAddress + offsetof(NEO::SbaTrackedAddresses, InstructionBaseAddress)), &instructionHeapBaseAddress, sizeof(instructionHeapBaseAddress)); - expectMemory(reinterpret_cast(sbaAddress + offsetof(SbaTrackedAddresses, BindlessSurfaceStateBaseAddress)), + expectMemory(reinterpret_cast(sbaAddress + offsetof(NEO::SbaTrackedAddresses, BindlessSurfaceStateBaseAddress)), &surfaceStateBaseAddress, sizeof(surfaceStateBaseAddress)); EXPECT_EQ(ZE_RESULT_SUCCESS, zeKernelDestroy(kernel)); diff --git a/level_zero/core/test/unit_tests/gen11/enable_l0_mocks_gen11.cpp b/level_zero/core/test/unit_tests/gen11/enable_l0_mocks_gen11.cpp index 0fc77861c0..77c3713165 100644 --- a/level_zero/core/test/unit_tests/gen11/enable_l0_mocks_gen11.cpp +++ b/level_zero/core/test/unit_tests/gen11/enable_l0_mocks_gen11.cpp @@ -17,4 +17,4 @@ namespace L0 { namespace ult { static MockDebuggerL0HwPopulateFactory mockDebuggerGen11; } -} // namespace L0 \ No newline at end of file +} // namespace L0 diff --git a/level_zero/core/test/unit_tests/gen12lp/enable_l0_mocks_gen12lp.cpp b/level_zero/core/test/unit_tests/gen12lp/enable_l0_mocks_gen12lp.cpp index 56ab2cc9cf..638771c07a 100644 --- a/level_zero/core/test/unit_tests/gen12lp/enable_l0_mocks_gen12lp.cpp +++ b/level_zero/core/test/unit_tests/gen12lp/enable_l0_mocks_gen12lp.cpp @@ -11,6 +11,7 @@ namespace NEO { struct TGLLPFamily; using GfxFamily = TGLLPFamily; + } // namespace NEO namespace L0 { diff --git a/level_zero/core/test/unit_tests/gen9/enable_l0_mocks_gen9.cpp b/level_zero/core/test/unit_tests/gen9/enable_l0_mocks_gen9.cpp index ac77fda14b..5ca014b4c1 100644 --- a/level_zero/core/test/unit_tests/gen9/enable_l0_mocks_gen9.cpp +++ b/level_zero/core/test/unit_tests/gen9/enable_l0_mocks_gen9.cpp @@ -8,7 +8,6 @@ #include "level_zero/core/test/unit_tests/mocks/mock_l0_debugger.h" namespace NEO { - struct SKLFamily; using GfxFamily = SKLFamily; } // namespace NEO diff --git a/level_zero/core/test/unit_tests/mocks/debugger_l0_create.cpp b/level_zero/core/test/unit_tests/mocks/debugger_l0_create.cpp index c35b7eca15..964da6e69e 100644 --- a/level_zero/core/test/unit_tests/mocks/debugger_l0_create.cpp +++ b/level_zero/core/test/unit_tests/mocks/debugger_l0_create.cpp @@ -9,17 +9,14 @@ #include "level_zero/core/test/unit_tests/mocks/mock_l0_debugger.h" -namespace L0 { -namespace ult { -DebugerL0CreateFn mockDebuggerL0HwFactory[IGFX_MAX_CORE]; -} -} // namespace L0 +NEO::DebugerL0CreateFn mockDebuggerL0HwFactory[IGFX_MAX_CORE]; -namespace L0 { -std::unique_ptr DebuggerL0::create(NEO::Device *device) { +namespace NEO { + +std::unique_ptr DebuggerL0::create(NEO::Device *device) { initDebuggingInOs(device->getRootDeviceEnvironment().osInterface.get()); - auto debugger = ult::mockDebuggerL0HwFactory[device->getHardwareInfo().platform.eRenderCoreFamily](device); + auto debugger = mockDebuggerL0HwFactory[device->getHardwareInfo().platform.eRenderCoreFamily](device); return std::unique_ptr(debugger); } -} // namespace L0 \ No newline at end of file +} // namespace NEO \ No newline at end of file diff --git a/level_zero/core/test/unit_tests/mocks/mock_l0_debugger.h b/level_zero/core/test/unit_tests/mocks/mock_l0_debugger.h index 737259e129..a562d15df8 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_l0_debugger.h +++ b/level_zero/core/test/unit_tests/mocks/mock_l0_debugger.h @@ -6,48 +6,50 @@ */ #pragma once +#include "shared/source/debugger/debugger_l0.h" #include "shared/source/kernel/debug_data.h" -#include "level_zero/core/source/debugger/debugger_l0.h" -#include "level_zero/core/test/unit_tests/white_box.h" +extern NEO::DebugerL0CreateFn mockDebuggerL0HwFactory[]; namespace L0 { namespace ult { -extern DebugerL0CreateFn mockDebuggerL0HwFactory[]; + +template +struct WhiteBox; template -class MockDebuggerL0Hw : public L0::DebuggerL0Hw { +class MockDebuggerL0Hw : public NEO::DebuggerL0Hw { public: - using L0::DebuggerL0::perContextSbaAllocations; - using L0::DebuggerL0::sbaTrackingGpuVa; - using L0::DebuggerL0::singleAddressSpaceSbaTracking; + using NEO::DebuggerL0::perContextSbaAllocations; + using NEO::DebuggerL0::sbaTrackingGpuVa; + using NEO::DebuggerL0::singleAddressSpaceSbaTracking; - MockDebuggerL0Hw(NEO::Device *device) : L0::DebuggerL0Hw(device) {} + MockDebuggerL0Hw(NEO::Device *device) : NEO::DebuggerL0Hw(device) {} ~MockDebuggerL0Hw() override = default; - static DebuggerL0 *allocate(NEO::Device *device) { + static NEO::DebuggerL0 *allocate(NEO::Device *device) { return new MockDebuggerL0Hw(device); } void captureStateBaseAddress(NEO::LinearStream &cmdStream, NEO::Debugger::SbaAddresses sba) override { captureStateBaseAddressCount++; - L0::DebuggerL0Hw::captureStateBaseAddress(cmdStream, sba); + NEO::DebuggerL0Hw::captureStateBaseAddress(cmdStream, sba); } size_t getSbaTrackingCommandsSize(size_t trackedAddressCount) override { getSbaTrackingCommandsSizeCount++; - return L0::DebuggerL0Hw::getSbaTrackingCommandsSize(trackedAddressCount); + return NEO::DebuggerL0Hw::getSbaTrackingCommandsSize(trackedAddressCount); } void programSbaTrackingCommands(NEO::LinearStream &cmdStream, const NEO::Debugger::SbaAddresses &sba) override { programSbaTrackingCommandsCount++; - L0::DebuggerL0Hw::programSbaTrackingCommands(cmdStream, sba); + NEO::DebuggerL0Hw::programSbaTrackingCommands(cmdStream, sba); } void registerElf(NEO::DebugData *debugData, NEO::GraphicsAllocation *isaAllocation) override { registerElfCount++; lastReceivedElf = debugData->vIsa; - L0::DebuggerL0Hw::registerElf(debugData, isaAllocation); + NEO::DebuggerL0Hw::registerElf(debugData, isaAllocation); } bool attachZebinModuleToSegmentAllocations(const StackVec &allocs, uint32_t &moduleHandle) override { @@ -56,22 +58,22 @@ class MockDebuggerL0Hw : public L0::DebuggerL0Hw { moduleHandle = moduleHandleToReturn; return true; } - return L0::DebuggerL0Hw::attachZebinModuleToSegmentAllocations(allocs, moduleHandle); + return NEO::DebuggerL0Hw::attachZebinModuleToSegmentAllocations(allocs, moduleHandle); } bool removeZebinModule(uint32_t moduleHandle) override { removedZebinModuleHandle = moduleHandle; - return L0::DebuggerL0Hw::removeZebinModule(moduleHandle); + return NEO::DebuggerL0Hw::removeZebinModule(moduleHandle); } void notifyCommandQueueCreated() override { commandQueueCreatedCount++; - L0::DebuggerL0Hw::notifyCommandQueueCreated(); + NEO::DebuggerL0Hw::notifyCommandQueueCreated(); } void notifyCommandQueueDestroyed() override { commandQueueDestroyedCount++; - L0::DebuggerL0Hw::notifyCommandQueueDestroyed(); + NEO::DebuggerL0Hw::notifyCommandQueueDestroyed(); } uint32_t captureStateBaseAddressCount = 0; @@ -87,18 +89,17 @@ class MockDebuggerL0Hw : public L0::DebuggerL0Hw { uint32_t moduleHandleToReturn = std::numeric_limits::max(); }; -template -struct MockDebuggerL0HwPopulateFactory { - MockDebuggerL0HwPopulateFactory() { - mockDebuggerL0HwFactory[productFamily] = MockDebuggerL0Hw::allocate; - } -}; - template <> -struct WhiteBox<::L0::DebuggerL0> : public ::L0::DebuggerL0 { - using BaseClass = ::L0::DebuggerL0; +struct WhiteBox : public NEO::DebuggerL0 { + using BaseClass = NEO::DebuggerL0; using BaseClass::initDebuggingInOs; }; +template +struct MockDebuggerL0HwPopulateFactory { + MockDebuggerL0HwPopulateFactory() { + mockDebuggerL0HwFactory[productFamily] = L0::ult::MockDebuggerL0Hw::allocate; + } +}; } // namespace ult -} // namespace L0 +} // namespace L0 \ No newline at end of file diff --git a/level_zero/core/test/unit_tests/sources/debugger/linux/test_l0_debugger_linux.cpp b/level_zero/core/test/unit_tests/sources/debugger/linux/test_l0_debugger_linux.cpp index 6dbb1ef2ea..696f0c2289 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/linux/test_l0_debugger_linux.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/linux/test_l0_debugger_linux.cpp @@ -94,7 +94,7 @@ TEST(L0DebuggerLinux, givenVmBindAndPerContextVmEnabledInDrmWhenInitializingDebu executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(osInterface); executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr(drmMock)); - auto result = WhiteBox<::L0::DebuggerL0>::initDebuggingInOs(osInterface); + auto result = WhiteBox::initDebuggingInOs(osInterface); EXPECT_TRUE(result); EXPECT_TRUE(drmMock->registerClassesCalled); } @@ -116,7 +116,7 @@ TEST(L0DebuggerLinux, givenVmBindNotAvailableInDrmWhenInitializingDebuggingInOsT executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(osInterface); executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr(drmMock)); - auto result = WhiteBox<::L0::DebuggerL0>::initDebuggingInOs(osInterface); + auto result = WhiteBox::initDebuggingInOs(osInterface); EXPECT_FALSE(result); EXPECT_FALSE(drmMock->registerClassesCalled); } @@ -138,7 +138,7 @@ TEST(L0DebuggerLinux, givenPerContextVmNotEnabledWhenInitializingDebuggingInOsTh executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(osInterface); executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr(drmMock)); - auto result = WhiteBox<::L0::DebuggerL0>::initDebuggingInOs(osInterface); + auto result = WhiteBox::initDebuggingInOs(osInterface); EXPECT_FALSE(result); EXPECT_FALSE(drmMock->registerClassesCalled); } diff --git a/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_sba_tracking.cpp b/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_sba_tracking.cpp index c18ca7983c..7eed96ec8e 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_sba_tracking.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger_sba_tracking.cpp @@ -60,7 +60,7 @@ HWTEST_P(L0DebuggerParameterizedTests, givenL0DebuggerWhenCreatedThenPerContextS } std::vector allocations; - auto &allEngines = device->getNEODevice()->getMemoryManager()->getRegisteredEngines(); + auto &allEngines = neoDevice->getMemoryManager()->getRegisteredEngines(); for (auto &engine : allEngines) { auto sbaAllocation = debugger->getSbaTrackingBuffer(engine.osContext->getContextId()); @@ -86,7 +86,7 @@ HWTEST_F(L0DebuggerTest, givenCreatedL0DebuggerThenSbaTrackingBuffersContainVali auto sbaAllocation = sbaBuffer.second; ASSERT_NE(nullptr, sbaAllocation); - auto sbaHeader = reinterpret_cast(sbaAllocation->getUnderlyingBuffer()); + auto sbaHeader = reinterpret_cast(sbaAllocation->getUnderlyingBuffer()); EXPECT_STREQ("sbaarea", sbaHeader->magic); EXPECT_EQ(0u, sbaHeader->BindlessSamplerStateBaseAddress); @@ -146,8 +146,8 @@ HWTEST_F(L0DebuggerMultiSubDeviceTest, givenMultiSubDevicesWhenSbaTrackingBuffer EXPECT_TRUE(storageInfo.tileInstanced); for (uint32_t i = 0; i < numSubDevices; i++) { - auto sbaHeader = reinterpret_cast(ptrOffset(debugger->perContextSbaAllocations[contextId]->getUnderlyingBuffer(), - debugger->perContextSbaAllocations[contextId]->getUnderlyingBufferSize() * i)); + auto sbaHeader = reinterpret_cast(ptrOffset(debugger->perContextSbaAllocations[contextId]->getUnderlyingBuffer(), + debugger->perContextSbaAllocations[contextId]->getUnderlyingBufferSize() * i)); EXPECT_STREQ("sbaarea", sbaHeader->magic); EXPECT_EQ(0u, sbaHeader->BindlessSamplerStateBaseAddress); @@ -245,7 +245,7 @@ HWTEST2_F(L0DebuggerPerContextAddressSpaceTest, givenDebuggingEnabledAndRequired EXPECT_EQ(static_cast(gsbaGpuVa & 0x0000FFFFFFFFULL), cmdSdi->getDataDword0()); EXPECT_EQ(static_cast(gsbaGpuVa >> 32), cmdSdi->getDataDword1()); - auto expectedGpuVa = gmmHelper->decanonize(device->getL0Debugger()->getSbaTrackingGpuVa()) + offsetof(SbaTrackedAddresses, GeneralStateBaseAddress); + auto expectedGpuVa = gmmHelper->decanonize(device->getL0Debugger()->getSbaTrackingGpuVa()) + offsetof(NEO::SbaTrackedAddresses, GeneralStateBaseAddress); EXPECT_EQ(expectedGpuVa, cmdSdi->getAddress()); for (auto i = 0u; i < numCommandLists; i++) { @@ -415,7 +415,7 @@ HWTEST_F(PerContextAddressSpaceFixture, givenNonZeroGpuVasWhenProgrammingSbaTrac auto debugger = std::make_unique>(neoDevice); debugger->singleAddressSpaceSbaTracking = 0; debugger->sbaTrackingGpuVa.address = 0x45670000; - auto expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(SbaTrackedAddresses, GeneralStateBaseAddress); + auto expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(NEO::SbaTrackedAddresses, GeneralStateBaseAddress); StackVec buffer(4096); NEO::LinearStream cmdStream(buffer.begin(), buffer.size()); @@ -452,7 +452,7 @@ HWTEST_F(PerContextAddressSpaceFixture, givenNonZeroGpuVasWhenProgrammingSbaTrac sdiItor++; cmdSdi = genCmdCast(*sdiItor); - expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(SbaTrackedAddresses, SurfaceStateBaseAddress); + expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(NEO::SbaTrackedAddresses, SurfaceStateBaseAddress); EXPECT_EQ(static_cast(ssba & 0x0000FFFFFFFFULL), cmdSdi->getDataDword0()); EXPECT_EQ(static_cast(ssba >> 32), cmdSdi->getDataDword1()); EXPECT_EQ(expectedGpuVa, cmdSdi->getAddress()); @@ -461,7 +461,7 @@ HWTEST_F(PerContextAddressSpaceFixture, givenNonZeroGpuVasWhenProgrammingSbaTrac sdiItor++; cmdSdi = genCmdCast(*sdiItor); - expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(SbaTrackedAddresses, DynamicStateBaseAddress); + expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(NEO::SbaTrackedAddresses, DynamicStateBaseAddress); EXPECT_EQ(static_cast(dsba & 0x0000FFFFFFFFULL), cmdSdi->getDataDword0()); EXPECT_EQ(static_cast(dsba >> 32), cmdSdi->getDataDword1()); @@ -471,7 +471,7 @@ HWTEST_F(PerContextAddressSpaceFixture, givenNonZeroGpuVasWhenProgrammingSbaTrac sdiItor++; cmdSdi = genCmdCast(*sdiItor); - expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(SbaTrackedAddresses, IndirectObjectBaseAddress); + expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(NEO::SbaTrackedAddresses, IndirectObjectBaseAddress); EXPECT_EQ(static_cast(ioba & 0x0000FFFFFFFFULL), cmdSdi->getDataDword0()); EXPECT_EQ(static_cast(ioba >> 32), cmdSdi->getDataDword1()); EXPECT_EQ(expectedGpuVa, cmdSdi->getAddress()); @@ -480,7 +480,7 @@ HWTEST_F(PerContextAddressSpaceFixture, givenNonZeroGpuVasWhenProgrammingSbaTrac sdiItor++; cmdSdi = genCmdCast(*sdiItor); - expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(SbaTrackedAddresses, InstructionBaseAddress); + expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(NEO::SbaTrackedAddresses, InstructionBaseAddress); EXPECT_EQ(static_cast(iba & 0x0000FFFFFFFFULL), cmdSdi->getDataDword0()); EXPECT_EQ(static_cast(iba >> 32), cmdSdi->getDataDword1()); EXPECT_EQ(expectedGpuVa, cmdSdi->getAddress()); @@ -489,7 +489,7 @@ HWTEST_F(PerContextAddressSpaceFixture, givenNonZeroGpuVasWhenProgrammingSbaTrac sdiItor++; cmdSdi = genCmdCast(*sdiItor); - expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(SbaTrackedAddresses, BindlessSurfaceStateBaseAddress); + expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(NEO::SbaTrackedAddresses, BindlessSurfaceStateBaseAddress); EXPECT_EQ(static_cast(ssba & 0x0000FFFFFFFFULL), cmdSdi->getDataDword0()); EXPECT_EQ(static_cast(ssba >> 32), cmdSdi->getDataDword1()); EXPECT_EQ(expectedGpuVa, cmdSdi->getAddress()); @@ -501,7 +501,7 @@ HWTEST_F(PerContextAddressSpaceFixture, givenCanonizedGpuVasWhenProgrammingSbaTr auto debugger = std::make_unique>(neoDevice); debugger->sbaTrackingGpuVa.address = 0x45670000; - auto expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(SbaTrackedAddresses, GeneralStateBaseAddress); + auto expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(NEO::SbaTrackedAddresses, GeneralStateBaseAddress); StackVec buffer(4096); NEO::LinearStream cmdStream(buffer.begin(), buffer.size()); @@ -538,7 +538,7 @@ HWTEST_F(PerContextAddressSpaceFixture, givenCanonizedGpuVasWhenProgrammingSbaTr sdiItor++; cmdSdi = genCmdCast(*sdiItor); - expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(SbaTrackedAddresses, SurfaceStateBaseAddress); + expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(NEO::SbaTrackedAddresses, SurfaceStateBaseAddress); EXPECT_EQ(static_cast(ssba & 0x0000FFFFFFFFULL), cmdSdi->getDataDword0()); EXPECT_EQ(static_cast(ssba >> 32), cmdSdi->getDataDword1()); @@ -548,7 +548,7 @@ HWTEST_F(PerContextAddressSpaceFixture, givenCanonizedGpuVasWhenProgrammingSbaTr sdiItor++; cmdSdi = genCmdCast(*sdiItor); - expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(SbaTrackedAddresses, DynamicStateBaseAddress); + expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(NEO::SbaTrackedAddresses, DynamicStateBaseAddress); EXPECT_EQ(static_cast(dsba & 0x0000FFFFFFFFULL), cmdSdi->getDataDword0()); EXPECT_EQ(static_cast(dsba >> 32), cmdSdi->getDataDword1()); EXPECT_EQ(expectedGpuVa, cmdSdi->getAddress()); @@ -557,7 +557,7 @@ HWTEST_F(PerContextAddressSpaceFixture, givenCanonizedGpuVasWhenProgrammingSbaTr sdiItor++; cmdSdi = genCmdCast(*sdiItor); - expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(SbaTrackedAddresses, IndirectObjectBaseAddress); + expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(NEO::SbaTrackedAddresses, IndirectObjectBaseAddress); EXPECT_EQ(static_cast(ioba & 0x0000FFFFFFFFULL), cmdSdi->getDataDword0()); EXPECT_EQ(static_cast(ioba >> 32), cmdSdi->getDataDword1()); EXPECT_EQ(expectedGpuVa, cmdSdi->getAddress()); @@ -566,7 +566,7 @@ HWTEST_F(PerContextAddressSpaceFixture, givenCanonizedGpuVasWhenProgrammingSbaTr sdiItor++; cmdSdi = genCmdCast(*sdiItor); - expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(SbaTrackedAddresses, InstructionBaseAddress); + expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(NEO::SbaTrackedAddresses, InstructionBaseAddress); EXPECT_EQ(static_cast(iba & 0x0000FFFFFFFFULL), cmdSdi->getDataDword0()); EXPECT_EQ(static_cast(iba >> 32), cmdSdi->getDataDword1()); EXPECT_EQ(expectedGpuVa, cmdSdi->getAddress()); @@ -575,7 +575,7 @@ HWTEST_F(PerContextAddressSpaceFixture, givenCanonizedGpuVasWhenProgrammingSbaTr sdiItor++; cmdSdi = genCmdCast(*sdiItor); - expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(SbaTrackedAddresses, BindlessSurfaceStateBaseAddress); + expectedGpuVa = debugger->sbaTrackingGpuVa.address + offsetof(NEO::SbaTrackedAddresses, BindlessSurfaceStateBaseAddress); EXPECT_EQ(static_cast(ssba & 0x0000FFFFFFFFULL), cmdSdi->getDataDword0()); EXPECT_EQ(static_cast(ssba >> 32), cmdSdi->getDataDword1()); EXPECT_EQ(expectedGpuVa, cmdSdi->getAddress()); diff --git a/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp b/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp index 33df26903f..1e89226288 100644 --- a/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp +++ b/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp @@ -5,6 +5,7 @@ * */ +#include "shared/source/debugger/debugger_l0.h" #include "shared/source/device_binary_format/patchtokens_decoder.h" #include "shared/source/helpers/local_memory_access_modes.h" #include "shared/source/helpers/ray_tracing_helper.h" @@ -20,7 +21,6 @@ #include "shared/test/unit_test/compiler_interface/linker_mock.h" #include "shared/test/unit_test/device_binary_format/patchtokens_tests.h" -#include "level_zero/core/source/debugger/debugger_l0.h" #include "level_zero/core/source/image/image_format_desc_helper.h" #include "level_zero/core/source/image/image_hw.h" #include "level_zero/core/source/kernel/kernel_hw.h" diff --git a/level_zero/core/test/unit_tests/xe_hpc_core/enable_l0_mocks_xe_hpc_core.cpp b/level_zero/core/test/unit_tests/xe_hpc_core/enable_l0_mocks_xe_hpc_core.cpp index 564ef7e565..710b5276f6 100644 --- a/level_zero/core/test/unit_tests/xe_hpc_core/enable_l0_mocks_xe_hpc_core.cpp +++ b/level_zero/core/test/unit_tests/xe_hpc_core/enable_l0_mocks_xe_hpc_core.cpp @@ -16,4 +16,4 @@ namespace L0 { namespace ult { static MockDebuggerL0HwPopulateFactory mockDebuggerXeHpcCore; } -} // namespace L0 \ No newline at end of file +} // namespace L0 diff --git a/level_zero/core/test/unit_tests/xe_hpg_core/enable_l0_mocks_xe_hpg_core.cpp b/level_zero/core/test/unit_tests/xe_hpg_core/enable_l0_mocks_xe_hpg_core.cpp index 29e5db9908..da65f6a229 100644 --- a/level_zero/core/test/unit_tests/xe_hpg_core/enable_l0_mocks_xe_hpg_core.cpp +++ b/level_zero/core/test/unit_tests/xe_hpg_core/enable_l0_mocks_xe_hpg_core.cpp @@ -16,4 +16,4 @@ namespace L0 { namespace ult { static MockDebuggerL0HwPopulateFactory mockDebuggerXeHpgCore; } -} // namespace L0 \ No newline at end of file +} // namespace L0 diff --git a/level_zero/tools/source/debug/debug_session.h b/level_zero/tools/source/debug/debug_session.h index ffbbfd7681..cdf1c4a2cc 100644 --- a/level_zero/tools/source/debug/debug_session.h +++ b/level_zero/tools/source/debug/debug_session.h @@ -6,9 +6,9 @@ */ #pragma once +#include "shared/source/debugger/debugger_l0.h" #include "shared/source/os_interface/os_thread.h" -#include "level_zero/core/source/debugger/debugger_l0.h" #include "level_zero/tools/source/debug/eu_thread.h" #include #include @@ -104,7 +104,7 @@ struct DebugSession : _zet_debug_session_handle_t { virtual bool isBindlessSystemRoutine(); virtual bool readModuleDebugArea() = 0; - virtual ze_result_t readSbaBuffer(EuThread::ThreadId threadId, SbaTrackedAddresses &sbaBuffer) = 0; + virtual ze_result_t readSbaBuffer(EuThread::ThreadId threadId, NEO::SbaTrackedAddresses &sbaBuffer) = 0; void fillDevicesFromThread(ze_device_thread_t thread, std::vector &devices); @@ -112,7 +112,7 @@ struct DebugSession : _zet_debug_session_handle_t { size_t getPerThreadScratchOffset(size_t ptss, EuThread::ThreadId threadId); - DebugAreaHeader debugArea; + NEO::DebugAreaHeader debugArea; Device *connectedDevice = nullptr; std::map> allThreads; diff --git a/level_zero/tools/source/debug/debug_session_imp.cpp b/level_zero/tools/source/debug/debug_session_imp.cpp index 22e014764e..dff2179bd7 100644 --- a/level_zero/tools/source/debug/debug_session_imp.cpp +++ b/level_zero/tools/source/debug/debug_session_imp.cpp @@ -817,7 +817,7 @@ ze_result_t DebugSessionImp::readSbaRegisters(ze_device_thread_t thread, uint32_ ze_result_t ret = ZE_RESULT_SUCCESS; - SbaTrackedAddresses sbaBuffer; + NEO::SbaTrackedAddresses sbaBuffer; ret = readSbaBuffer(convertToThreadId(thread), sbaBuffer); if (ret != ZE_RESULT_SUCCESS) { return ret; diff --git a/level_zero/tools/source/debug/linux/prelim/debug_session.cpp b/level_zero/tools/source/debug/linux/prelim/debug_session.cpp index 9e2073df3d..ab72f3566d 100644 --- a/level_zero/tools/source/debug/linux/prelim/debug_session.cpp +++ b/level_zero/tools/source/debug/linux/prelim/debug_session.cpp @@ -608,7 +608,7 @@ bool DebugSessionLinux::readModuleDebugArea() { memset(this->debugArea.magic, 0, sizeof(this->debugArea.magic)); auto retVal = readGpuMemory(vm, reinterpret_cast(&this->debugArea), sizeof(this->debugArea), gpuVa); - if (retVal != ZE_RESULT_SUCCESS || strncmp(this->debugArea.magic, "dbgarea", sizeof(DebugAreaHeader::magic)) != 0) { + if (retVal != ZE_RESULT_SUCCESS || strncmp(this->debugArea.magic, "dbgarea", sizeof(NEO::DebugAreaHeader::magic)) != 0) { PRINT_DEBUGGER_ERROR_LOG("Reading Module Debug Area failed, error = %d\n", retVal); return false; } @@ -1444,7 +1444,7 @@ bool DebugSessionLinux::readSystemRoutineIdent(EuThread *thread, uint64_t vmHand return true; } -ze_result_t DebugSessionLinux::readSbaBuffer(EuThread::ThreadId threadId, SbaTrackedAddresses &sbaBuffer) { +ze_result_t DebugSessionLinux::readSbaBuffer(EuThread::ThreadId threadId, NEO::SbaTrackedAddresses &sbaBuffer) { auto vmHandle = allThreads[threadId]->getMemoryHandle(); if (vmHandle == invalidHandle) { diff --git a/level_zero/tools/source/debug/linux/prelim/debug_session.h b/level_zero/tools/source/debug/linux/prelim/debug_session.h index 071ea51664..b0682c1a38 100644 --- a/level_zero/tools/source/debug/linux/prelim/debug_session.h +++ b/level_zero/tools/source/debug/linux/prelim/debug_session.h @@ -219,7 +219,7 @@ struct DebugSessionLinux : DebugSessionImp { uint64_t extractVaFromUuidString(std::string &uuid); bool readModuleDebugArea() override; - ze_result_t readSbaBuffer(EuThread::ThreadId, SbaTrackedAddresses &sbaBuffer) override; + ze_result_t readSbaBuffer(EuThread::ThreadId, NEO::SbaTrackedAddresses &sbaBuffer) override; void readStateSaveAreaHeader() override; void applyResumeWa(std::vector threads, uint8_t *bitmask, size_t bitmaskSize); diff --git a/level_zero/tools/source/debug/windows/debug_session.cpp b/level_zero/tools/source/debug/windows/debug_session.cpp index d7cf4872a9..bdfad7a252 100644 --- a/level_zero/tools/source/debug/windows/debug_session.cpp +++ b/level_zero/tools/source/debug/windows/debug_session.cpp @@ -456,7 +456,7 @@ bool DebugSessionWindows::readModuleDebugArea() { return false; } -ze_result_t DebugSessionWindows::readSbaBuffer(EuThread::ThreadId, SbaTrackedAddresses &sbaBuffer) { +ze_result_t DebugSessionWindows::readSbaBuffer(EuThread::ThreadId, NEO::SbaTrackedAddresses &sbaBuffer) { return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/level_zero/tools/source/debug/windows/debug_session.h b/level_zero/tools/source/debug/windows/debug_session.h index 6f3d0564a3..2c0e241dfb 100644 --- a/level_zero/tools/source/debug/windows/debug_session.h +++ b/level_zero/tools/source/debug/windows/debug_session.h @@ -44,7 +44,7 @@ struct DebugSessionWindows : DebugSessionImp { bool isVAElf(const zet_debug_memory_space_desc_t *desc, size_t size); ze_result_t readElfSpace(const zet_debug_memory_space_desc_t *desc, size_t size, void *buffer); - ze_result_t readSbaBuffer(EuThread::ThreadId, SbaTrackedAddresses &sbaBuffer) override; + ze_result_t readSbaBuffer(EuThread::ThreadId, NEO::SbaTrackedAddresses &sbaBuffer) override; MOCKABLE_VIRTUAL ze_result_t readAndHandleEvent(uint64_t timeoutMs); ze_result_t handleModuleCreateEvent(DBGUMD_READ_EVENT_MODULE_CREATE_EVENT_PARAMS &moduleCreateParams); diff --git a/level_zero/tools/test/unit_tests/sources/debug/debug_session_tests.cpp b/level_zero/tools/test/unit_tests/sources/debug/debug_session_tests.cpp index 1b57ec1e13..46b86c3ba9 100644 --- a/level_zero/tools/test/unit_tests/sources/debug/debug_session_tests.cpp +++ b/level_zero/tools/test/unit_tests/sources/debug/debug_session_tests.cpp @@ -103,7 +103,7 @@ struct MockDebugSession : public L0::DebugSessionImp { return DebugSessionImp::writeRegistersImp(thread, type, start, count, pRegisterValues); } - ze_result_t readSbaBuffer(EuThread::ThreadId threadId, SbaTrackedAddresses &sbaBuffer) override { + ze_result_t readSbaBuffer(EuThread::ThreadId threadId, NEO::SbaTrackedAddresses &sbaBuffer) override { sbaBuffer = sba; return readSbaBufferResult; } @@ -246,7 +246,7 @@ struct MockDebugSession : public L0::DebugSessionImp { std::vector resumedDevices; std::vector> resumedThreads; - SbaTrackedAddresses sba; + NEO::SbaTrackedAddresses sba; uint64_t readMemoryBuffer[64]; uint64_t regs[16]; diff --git a/level_zero/tools/test/unit_tests/sources/debug/mock_debug_session.h b/level_zero/tools/test/unit_tests/sources/debug/mock_debug_session.h index a62add21f4..ba49566400 100644 --- a/level_zero/tools/test/unit_tests/sources/debug/mock_debug_session.h +++ b/level_zero/tools/test/unit_tests/sources/debug/mock_debug_session.h @@ -63,7 +63,7 @@ struct DebugSessionMock : public L0::DebugSession { ze_result_t writeRegisters(ze_device_thread_t thread, uint32_t type, uint32_t start, uint32_t count, void *pRegisterValues) override { return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - ze_result_t readSbaBuffer(EuThread::ThreadId threadId, SbaTrackedAddresses &sbaBuffer) override { + ze_result_t readSbaBuffer(EuThread::ThreadId threadId, NEO::SbaTrackedAddresses &sbaBuffer) override { return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } void startAsyncThread() override { diff --git a/shared/source/CMakeLists.txt b/shared/source/CMakeLists.txt index ac8664f2ed..74599e60b7 100644 --- a/shared/source/CMakeLists.txt +++ b/shared/source/CMakeLists.txt @@ -152,6 +152,7 @@ if(WIN32) NEO_CORE_OS_INTERFACE_WDDM NEO_CORE_PAGE_FAULT_MANAGER_WINDOWS NEO_CORE_SKU_INFO_WINDOWS + NEO_CORE_SRCS_DEBUGGER_WINDOWS NEO_CORE_SRCS_HELPERS_WINDOWS NEO_CORE_UTILITIES_WINDOWS NEO_CORE_EXECUTION_ENVIRONMENT_WDDM @@ -162,6 +163,7 @@ else() NEO_CORE_DIRECT_SUBMISSION_LINUX NEO_CORE_OS_INTERFACE_LINUX NEO_CORE_PAGE_FAULT_MANAGER_LINUX + NEO_CORE_SRCS_DEBUGGER_LINUX NEO_CORE_UTILITIES_LINUX NEO_CORE_EXECUTION_ENVIRONMENT_DRM NEO_CORE_AIL_LINUX diff --git a/shared/source/debugger/CMakeLists.txt b/shared/source/debugger/CMakeLists.txt index 06918a3868..06495419cc 100644 --- a/shared/source/debugger/CMakeLists.txt +++ b/shared/source/debugger/CMakeLists.txt @@ -8,6 +8,14 @@ set(NEO_CORE_DEBUGGER ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/debugger.cpp ${CMAKE_CURRENT_SOURCE_DIR}/debugger.h + ${CMAKE_CURRENT_SOURCE_DIR}/debugger_l0.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/debugger_l0.h + ${CMAKE_CURRENT_SOURCE_DIR}/debugger_l0.inl + ${CMAKE_CURRENT_SOURCE_DIR}/debugger_l0_base.inl + ${CMAKE_CURRENT_SOURCE_DIR}/debugger_l0_tgllp_and_later.inl ) set_property(GLOBAL PROPERTY NEO_CORE_DEBUGGER ${NEO_CORE_DEBUGGER}) + +add_subdirectories() + diff --git a/level_zero/core/source/debugger/debugger_l0.cpp b/shared/source/debugger/debugger_l0.cpp similarity index 98% rename from level_zero/core/source/debugger/debugger_l0.cpp rename to shared/source/debugger/debugger_l0.cpp index ad437169f0..f47a46107e 100644 --- a/level_zero/core/source/debugger/debugger_l0.cpp +++ b/shared/source/debugger/debugger_l0.cpp @@ -5,7 +5,7 @@ * */ -#include "level_zero/core/source/debugger/debugger_l0.h" +#include "shared/source/debugger/debugger_l0.h" #include "shared/source/command_container/cmdcontainer.h" #include "shared/source/debug_settings/debug_settings_manager.h" @@ -18,7 +18,7 @@ #include -namespace L0 { +namespace NEO { DebugerL0CreateFn debuggerL0Factory[IGFX_MAX_CORE] = {}; @@ -132,4 +132,4 @@ void DebuggerL0::notifyModuleLoadAllocations(const StackVec void DebuggerL0Hw::programSbaTrackingCommands(NEO::LinearStream &cmdStream, const SbaAddresses &sba) { @@ -135,4 +134,4 @@ void DebuggerL0Hw::programSbaAddressLoad(NEO::LinearStream &cmdStream true); } -} // namespace L0 +} // namespace NEO \ No newline at end of file diff --git a/level_zero/core/source/debugger/debugger_l0_base.inl b/shared/source/debugger/debugger_l0_base.inl similarity index 94% rename from level_zero/core/source/debugger/debugger_l0_base.inl rename to shared/source/debugger/debugger_l0_base.inl index 2b8479ab84..e6426e3bf4 100644 --- a/level_zero/core/source/debugger/debugger_l0_base.inl +++ b/shared/source/debugger/debugger_l0_base.inl @@ -5,7 +5,7 @@ * */ -namespace L0 { +namespace NEO { template size_t DebuggerL0Hw::getSbaTrackingCommandsSize(size_t trackedAddressCount) { if (singleAddressSpaceSbaTracking) { @@ -19,4 +19,4 @@ template void DebuggerL0Hw::programSbaTrackingCommandsSingleAddressSpace(NEO::LinearStream &cmdStream, const SbaAddresses &sba) { UNRECOVERABLE_IF(true); } -} // namespace L0 \ No newline at end of file +} // namespace NEO \ No newline at end of file diff --git a/level_zero/core/source/debugger/debugger_l0_tgllp_and_later.inl b/shared/source/debugger/debugger_l0_tgllp_and_later.inl similarity index 96% rename from level_zero/core/source/debugger/debugger_l0_tgllp_and_later.inl rename to shared/source/debugger/debugger_l0_tgllp_and_later.inl index 28e36a13e5..4cf60bee43 100644 --- a/level_zero/core/source/debugger/debugger_l0_tgllp_and_later.inl +++ b/shared/source/debugger/debugger_l0_tgllp_and_later.inl @@ -5,7 +5,7 @@ * */ -namespace L0 { +namespace NEO { template size_t DebuggerL0Hw::getSbaTrackingCommandsSize(size_t trackedAddressCount) { if (singleAddressSpaceSbaTracking) { @@ -64,7 +64,7 @@ void DebuggerL0Hw::programSbaTrackingCommandsSingleAddressSpace(NEO:: // Jump to SDI command that is modified auto newBuffer = cmdStream.getSpaceForCmd(); - const auto nextCommand = ptrOffset(cmdStreamGpuBase, ptrDiff(reinterpret_cast(cmdStream.getSpace(0)), cmdStreamCpuBase)); + const auto nextCommand = ptrOffset(cmdStreamGpuBase, ptrDiff(cmdStream.getSpace(0), cmdStreamCpuBase)); MI_BATCH_BUFFER_START bbCmd = GfxFamily::cmdInitBatchBufferStart; bbCmd.setAddressSpaceIndicator(MI_BATCH_BUFFER_START::ADDRESS_SPACE_INDICATOR_PPGTT); @@ -95,7 +95,7 @@ void DebuggerL0Hw::programSbaTrackingCommandsSingleAddressSpace(NEO:: // Jump to SDI command that is modified auto newBuffer = cmdStream.getSpaceForCmd(); - const auto addressOfSDI = ptrOffset(cmdStreamGpuBase, ptrDiff(reinterpret_cast(cmdStream.getSpace(0)), cmdStreamCpuBase)); + const auto addressOfSDI = ptrOffset(cmdStreamGpuBase, ptrDiff(cmdStream.getSpace(0), cmdStreamCpuBase)); // Cmd to store value ( SBA address ) auto miStoreSbaField = cmdStream.getSpaceForCmd(); @@ -141,7 +141,7 @@ void DebuggerL0Hw::programSbaTrackingCommandsSingleAddressSpace(NEO:: if (fieldOffsetAndValue.size()) { auto previousBuffer = cmdStream.getSpaceForCmd(); - const auto addressOfPreviousBuffer = ptrOffset(cmdStreamGpuBase, ptrDiff(reinterpret_cast(cmdStream.getSpace(0)), cmdStreamCpuBase)); + const auto addressOfPreviousBuffer = ptrOffset(cmdStreamGpuBase, ptrDiff(cmdStream.getSpace(0), cmdStreamCpuBase)); MI_BATCH_BUFFER_START bbCmd = GfxFamily::cmdInitBatchBufferStart; bbCmd.setAddressSpaceIndicator(MI_BATCH_BUFFER_START::ADDRESS_SPACE_INDICATOR_PPGTT); @@ -156,4 +156,4 @@ void DebuggerL0Hw::programSbaTrackingCommandsSingleAddressSpace(NEO:: } } -} // namespace L0 +} // namespace NEO diff --git a/level_zero/core/source/debugger/linux/CMakeLists.txt b/shared/source/debugger/linux/CMakeLists.txt similarity index 59% rename from level_zero/core/source/debugger/linux/CMakeLists.txt rename to shared/source/debugger/linux/CMakeLists.txt index 20da08ef7f..d678beed1d 100644 --- a/level_zero/core/source/debugger/linux/CMakeLists.txt +++ b/shared/source/debugger/linux/CMakeLists.txt @@ -4,11 +4,9 @@ # SPDX-License-Identifier: MIT # -set(L0_SRCS_DEBUGGER_LINUX +set(NEO_CORE_SRCS_DEBUGGER_LINUX ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/debugger_l0_linux.cpp ) -if(UNIX) - set_property(GLOBAL PROPERTY L0_SRCS_DEBUGGER_LINUX ${L0_SRCS_DEBUGGER_LINUX}) -endif() +set_property(GLOBAL PROPERTY NEO_CORE_SRCS_DEBUGGER_LINUX ${NEO_CORE_SRCS_DEBUGGER_LINUX}) \ No newline at end of file diff --git a/level_zero/core/source/debugger/linux/debugger_l0_linux.cpp b/shared/source/debugger/linux/debugger_l0_linux.cpp similarity index 97% rename from level_zero/core/source/debugger/linux/debugger_l0_linux.cpp rename to shared/source/debugger/linux/debugger_l0_linux.cpp index 32f0c75954..a318f7d8e1 100644 --- a/level_zero/core/source/debugger/linux/debugger_l0_linux.cpp +++ b/shared/source/debugger/linux/debugger_l0_linux.cpp @@ -5,15 +5,14 @@ * */ +#include "shared/source/debugger/debugger_l0.h" #include "shared/source/device/device.h" #include "shared/source/helpers/hw_helper.h" #include "shared/source/kernel/debug_data.h" #include "shared/source/os_interface/linux/drm_allocation.h" #include "shared/source/os_interface/linux/drm_neo.h" #include "shared/source/os_interface/os_interface.h" - -#include "level_zero/core/source/debugger/debugger_l0.h" -namespace L0 { +namespace NEO { bool DebuggerL0::initDebuggingInOs(NEO::OSInterface *osInterface) { if (osInterface != nullptr) { auto drm = osInterface->getDriverModel()->as(); @@ -81,4 +80,4 @@ void DebuggerL0::notifyCommandQueueDestroyed() { } } -} // namespace L0 +} // namespace NEO diff --git a/level_zero/core/source/debugger/windows/CMakeLists.txt b/shared/source/debugger/windows/CMakeLists.txt similarity index 58% rename from level_zero/core/source/debugger/windows/CMakeLists.txt rename to shared/source/debugger/windows/CMakeLists.txt index ff79682b20..8d545cc5cc 100644 --- a/level_zero/core/source/debugger/windows/CMakeLists.txt +++ b/shared/source/debugger/windows/CMakeLists.txt @@ -4,11 +4,9 @@ # SPDX-License-Identifier: MIT # -set(L0_SRCS_DEBUGGER_WINDOWS +set(NEO_CORE_SRCS_DEBUGGER_WINDOWS ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/debugger_l0_windows.cpp ) -if(WIN32) - set_property(GLOBAL PROPERTY L0_SRCS_DEBUGGER_WINDOWS ${L0_SRCS_DEBUGGER_WINDOWS}) -endif() +set_property(GLOBAL PROPERTY NEO_CORE_SRCS_DEBUGGER_WINDOWS ${NEO_CORE_SRCS_DEBUGGER_WINDOWS}) diff --git a/level_zero/core/source/debugger/windows/debugger_l0_windows.cpp b/shared/source/debugger/windows/debugger_l0_windows.cpp similarity index 92% rename from level_zero/core/source/debugger/windows/debugger_l0_windows.cpp rename to shared/source/debugger/windows/debugger_l0_windows.cpp index b43025a75b..b2c8377e18 100644 --- a/level_zero/core/source/debugger/windows/debugger_l0_windows.cpp +++ b/shared/source/debugger/windows/debugger_l0_windows.cpp @@ -5,14 +5,13 @@ * */ +#include "shared/source/debugger/debugger_l0.h" #include "shared/source/device/device.h" #include "shared/source/helpers/hw_helper.h" #include "shared/source/kernel/debug_data.h" #include "shared/source/os_interface/windows/wddm/wddm.h" -#include "level_zero/core/source/debugger/debugger_l0.h" - -namespace L0 { +namespace NEO { bool DebuggerL0::initDebuggingInOs(NEO::OSInterface *osInterface) { if (osInterface == nullptr) { @@ -46,4 +45,4 @@ void DebuggerL0::notifyCommandQueueCreated() { void DebuggerL0::notifyCommandQueueDestroyed() { } -} // namespace L0 +} // namespace NEO diff --git a/level_zero/core/source/dll/linux/debugger_l0_linux.cpp b/shared/source/dll/linux/debugger_l0_dll_linux.cpp similarity index 89% rename from level_zero/core/source/dll/linux/debugger_l0_linux.cpp rename to shared/source/dll/linux/debugger_l0_dll_linux.cpp index fd5d5a7059..089d3c4ff6 100644 --- a/level_zero/core/source/dll/linux/debugger_l0_linux.cpp +++ b/shared/source/dll/linux/debugger_l0_dll_linux.cpp @@ -5,13 +5,12 @@ * */ +#include "shared/source/debugger/debugger_l0.h" #include "shared/source/device/device.h" #include "shared/source/os_interface/linux/drm_neo.h" #include "shared/source/os_interface/os_interface.h" -#include "level_zero/core/source/debugger/debugger_l0.h" - -namespace L0 { +namespace NEO { std::unique_ptr DebuggerL0::create(NEO::Device *device) { auto &hwInfo = device->getHardwareInfo(); if (!hwInfo.capabilityTable.l0DebuggerSupported) { @@ -25,4 +24,4 @@ std::unique_ptr DebuggerL0::create(NEO::Device *device) { return std::unique_ptr(nullptr); } -} // namespace L0 \ No newline at end of file +} // namespace NEO \ No newline at end of file diff --git a/level_zero/core/source/dll/windows/debugger_l0_windows.cpp b/shared/source/dll/windows/debugger_l0_windows.cpp similarity index 87% rename from level_zero/core/source/dll/windows/debugger_l0_windows.cpp rename to shared/source/dll/windows/debugger_l0_windows.cpp index a4e9872fc9..78029455ae 100644 --- a/level_zero/core/source/dll/windows/debugger_l0_windows.cpp +++ b/shared/source/dll/windows/debugger_l0_windows.cpp @@ -5,9 +5,9 @@ * */ -#include "level_zero/core/source/debugger/debugger_l0.h" +#include "shared/source/debugger/debugger_l0.h" -namespace L0 { +namespace NEO { std::unique_ptr DebuggerL0::create(NEO::Device *device) { auto &hwInfo = device->getHardwareInfo(); if (!hwInfo.capabilityTable.l0DebuggerSupported) { @@ -20,4 +20,4 @@ std::unique_ptr DebuggerL0::create(NEO::Device *device) { } return std::unique_ptr(nullptr); } -} // namespace L0 \ No newline at end of file +} // namespace NEO \ No newline at end of file diff --git a/shared/source/enable_cores.cmake b/shared/source/enable_cores.cmake index c555e64a85..b565da7a5a 100644 --- a/shared/source/enable_cores.cmake +++ b/shared/source/enable_cores.cmake @@ -18,6 +18,7 @@ set(CORE_RUNTIME_SRCS_COREX_CPP_BASE command_stream_receiver_hw command_stream_receiver_simulated_common_hw create_device_command_stream_receiver + debugger direct_submission experimental_command_buffer implicit_scaling diff --git a/shared/source/gen11/debugger_gen11.cpp b/shared/source/gen11/debugger_gen11.cpp new file mode 100644 index 0000000000..3abd0ce09d --- /dev/null +++ b/shared/source/gen11/debugger_gen11.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2020-2022 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/debugger/debugger_l0.inl" +#include "shared/source/debugger/debugger_l0_base.inl" +#include "shared/source/helpers/populate_factory.h" + +namespace NEO { +struct ICLFamily; +using GfxFamily = ICLFamily; +static auto coreFamily = IGFX_GEN11_CORE; + +template <> +void populateFactoryTable>() { + extern DebugerL0CreateFn debuggerL0Factory[IGFX_MAX_CORE]; + debuggerL0Factory[coreFamily] = DebuggerL0Hw::allocate; +} +template class DebuggerL0Hw; +} // namespace NEO \ No newline at end of file diff --git a/shared/source/gen11/enable_family_full_core_gen11.cpp b/shared/source/gen11/enable_family_full_core_gen11.cpp index 9ec7661fab..4e8f5e03c7 100644 --- a/shared/source/gen11/enable_family_full_core_gen11.cpp +++ b/shared/source/gen11/enable_family_full_core_gen11.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -8,6 +8,7 @@ #include "shared/source/command_stream/aub_command_stream_receiver_hw.h" #include "shared/source/command_stream/command_stream_receiver_hw.h" #include "shared/source/command_stream/tbx_command_stream_receiver_hw.h" +#include "shared/source/debugger/debugger_l0.h" #include "shared/source/gen11/hw_cmds.h" #include "shared/source/helpers/hw_helper.h" #include "shared/source/helpers/populate_factory.h" @@ -25,6 +26,7 @@ struct EnableCoreGen11 { populateFactoryTable>(); populateFactoryTable>(); populateFactoryTable>(); + populateFactoryTable>(); } }; diff --git a/shared/source/gen12lp/debugger_gen12lp.cpp b/shared/source/gen12lp/debugger_gen12lp.cpp new file mode 100644 index 0000000000..fe9496d416 --- /dev/null +++ b/shared/source/gen12lp/debugger_gen12lp.cpp @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2020-2022 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/debugger/debugger_l0.inl" +#include "shared/source/debugger/debugger_l0_tgllp_and_later.inl" +#include "shared/source/helpers/populate_factory.h" + +namespace NEO { + +using Family = NEO::TGLLPFamily; + +static auto coreFamily = IGFX_GEN12LP_CORE; + +template <> +void populateFactoryTable>() { + extern DebugerL0CreateFn debuggerL0Factory[IGFX_MAX_CORE]; + debuggerL0Factory[coreFamily] = DebuggerL0Hw::allocate; +} +template class DebuggerL0Hw; +} // namespace NEO \ No newline at end of file diff --git a/shared/source/gen12lp/enable_family_full_core_gen12lp.cpp b/shared/source/gen12lp/enable_family_full_core_gen12lp.cpp index 830b3241cd..7c8def8814 100644 --- a/shared/source/gen12lp/enable_family_full_core_gen12lp.cpp +++ b/shared/source/gen12lp/enable_family_full_core_gen12lp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -8,6 +8,7 @@ #include "shared/source/command_stream/aub_command_stream_receiver_hw.h" #include "shared/source/command_stream/command_stream_receiver_hw.h" #include "shared/source/command_stream/tbx_command_stream_receiver_hw.h" +#include "shared/source/debugger/debugger_l0.h" #include "shared/source/gen12lp/hw_cmds.h" #include "shared/source/helpers/hw_helper.h" #include "shared/source/helpers/populate_factory.h" @@ -25,6 +26,7 @@ struct EnableCoreGen12LP { populateFactoryTable>(); populateFactoryTable>(); populateFactoryTable>(); + populateFactoryTable>(); } }; diff --git a/shared/source/gen8/debugger_gen8.cpp b/shared/source/gen8/debugger_gen8.cpp new file mode 100644 index 0000000000..7b1afd5f2d --- /dev/null +++ b/shared/source/gen8/debugger_gen8.cpp @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2020-2022 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/debugger/debugger_l0.inl" +#include "shared/source/debugger/debugger_l0_base.inl" +#include "shared/source/helpers/populate_factory.h" + +namespace NEO { + +struct BDWFamily; +using GfxFamily = BDWFamily; +static auto coreFamily = IGFX_GEN8_CORE; + +template <> +void populateFactoryTable>() { + extern DebugerL0CreateFn debuggerL0Factory[IGFX_MAX_CORE]; + debuggerL0Factory[coreFamily] = DebuggerL0Hw::allocate; +} +template class DebuggerL0Hw; +} // namespace NEO \ No newline at end of file diff --git a/shared/source/gen8/enable_family_full_core_gen8.cpp b/shared/source/gen8/enable_family_full_core_gen8.cpp index 8f06898525..64df61bb29 100644 --- a/shared/source/gen8/enable_family_full_core_gen8.cpp +++ b/shared/source/gen8/enable_family_full_core_gen8.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -8,6 +8,7 @@ #include "shared/source/command_stream/aub_command_stream_receiver_hw.h" #include "shared/source/command_stream/command_stream_receiver_hw.h" #include "shared/source/command_stream/tbx_command_stream_receiver_hw.h" +#include "shared/source/debugger/debugger_l0.h" #include "shared/source/gen8/hw_cmds.h" #include "shared/source/helpers/hw_helper.h" #include "shared/source/helpers/populate_factory.h" @@ -27,6 +28,7 @@ struct EnableCoreGen8 { populateFactoryTable>(); populateFactoryTable>(); populateFactoryTable>(); + populateFactoryTable>(); } }; diff --git a/shared/source/gen9/debugger_gen9.cpp b/shared/source/gen9/debugger_gen9.cpp new file mode 100644 index 0000000000..bd7005780b --- /dev/null +++ b/shared/source/gen9/debugger_gen9.cpp @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2020-2022 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/debugger/debugger_l0.inl" +#include "shared/source/debugger/debugger_l0_base.inl" +#include "shared/source/helpers/populate_factory.h" + +namespace NEO { +struct SKLFamily; +using GfxFamily = SKLFamily; + +static auto coreFamily = IGFX_GEN9_CORE; + +template <> +void populateFactoryTable>() { + extern DebugerL0CreateFn debuggerL0Factory[IGFX_MAX_CORE]; + debuggerL0Factory[coreFamily] = DebuggerL0Hw::allocate; +} +template class DebuggerL0Hw; +} // namespace NEO \ No newline at end of file diff --git a/shared/source/gen9/enable_family_full_core_gen9.cpp b/shared/source/gen9/enable_family_full_core_gen9.cpp index 750e38f5f3..bb879f459c 100644 --- a/shared/source/gen9/enable_family_full_core_gen9.cpp +++ b/shared/source/gen9/enable_family_full_core_gen9.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -8,6 +8,7 @@ #include "shared/source/command_stream/aub_command_stream_receiver_hw.h" #include "shared/source/command_stream/command_stream_receiver_hw.h" #include "shared/source/command_stream/tbx_command_stream_receiver_hw.h" +#include "shared/source/debugger/debugger_l0.h" #include "shared/source/gen9/hw_cmds.h" #include "shared/source/helpers/hw_helper.h" #include "shared/source/helpers/populate_factory.h" @@ -27,6 +28,7 @@ struct EnableCoreGen9 { populateFactoryTable>(); populateFactoryTable>(); populateFactoryTable>(); + populateFactoryTable>(); } }; diff --git a/shared/source/xe_hp_core/debugger_xe_hp_core.cpp b/shared/source/xe_hp_core/debugger_xe_hp_core.cpp new file mode 100644 index 0000000000..4aaba150da --- /dev/null +++ b/shared/source/xe_hp_core/debugger_xe_hp_core.cpp @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2021-2022 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/debugger/debugger_l0.inl" +#include "shared/source/debugger/debugger_l0_tgllp_and_later.inl" +#include "shared/source/helpers/populate_factory.h" + +namespace NEO { + +using GfxFamily = NEO::XeHpFamily; +static auto coreFamily = IGFX_XE_HP_CORE; + +template <> +void populateFactoryTable>() { + extern DebugerL0CreateFn debuggerL0Factory[IGFX_MAX_CORE]; + debuggerL0Factory[coreFamily] = DebuggerL0Hw::allocate; +} +template class DebuggerL0Hw; + +} // namespace NEO diff --git a/shared/source/xe_hp_core/enable_family_full_core_xe_hp_core.cpp b/shared/source/xe_hp_core/enable_family_full_core_xe_hp_core.cpp index eec3fcf727..3e3aefd097 100644 --- a/shared/source/xe_hp_core/enable_family_full_core_xe_hp_core.cpp +++ b/shared/source/xe_hp_core/enable_family_full_core_xe_hp_core.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -8,6 +8,7 @@ #include "shared/source/command_stream/aub_command_stream_receiver_hw.h" #include "shared/source/command_stream/command_stream_receiver_hw.h" #include "shared/source/command_stream/tbx_command_stream_receiver_hw.h" +#include "shared/source/debugger/debugger_l0.h" #include "shared/source/helpers/hw_helper.h" #include "shared/source/helpers/populate_factory.h" #include "shared/source/xe_hp_core/hw_cmds.h" @@ -25,6 +26,7 @@ struct EnableCoreXeHpCore { populateFactoryTable>(); populateFactoryTable>(); populateFactoryTable>(); + populateFactoryTable>(); } }; diff --git a/shared/source/xe_hpc_core/debugger_xe_hpc_core.cpp b/shared/source/xe_hpc_core/debugger_xe_hpc_core.cpp new file mode 100644 index 0000000000..0906b6d338 --- /dev/null +++ b/shared/source/xe_hpc_core/debugger_xe_hpc_core.cpp @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2021-2022 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/debugger/debugger_l0.inl" +#include "shared/source/debugger/debugger_l0_tgllp_and_later.inl" +#include "shared/source/helpers/populate_factory.h" + +namespace NEO { + +using Family = NEO::XE_HPC_COREFamily; + +static auto coreFamily = IGFX_XE_HPC_CORE; + +template <> +void populateFactoryTable>() { + extern DebugerL0CreateFn debuggerL0Factory[IGFX_MAX_CORE]; + debuggerL0Factory[coreFamily] = DebuggerL0Hw::allocate; +} +template class DebuggerL0Hw; +} // namespace NEO \ No newline at end of file diff --git a/shared/source/xe_hpc_core/enable_family_full_core_xe_hpc_core.cpp b/shared/source/xe_hpc_core/enable_family_full_core_xe_hpc_core.cpp index 0120df2d3d..39be2b8395 100644 --- a/shared/source/xe_hpc_core/enable_family_full_core_xe_hpc_core.cpp +++ b/shared/source/xe_hpc_core/enable_family_full_core_xe_hpc_core.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -8,6 +8,7 @@ #include "shared/source/command_stream/aub_command_stream_receiver_hw.h" #include "shared/source/command_stream/command_stream_receiver_hw.h" #include "shared/source/command_stream/tbx_command_stream_receiver_hw.h" +#include "shared/source/debugger/debugger_l0.h" #include "shared/source/helpers/hw_helper.h" #include "shared/source/helpers/populate_factory.h" #include "shared/source/xe_hpc_core/hw_cmds.h" @@ -25,6 +26,7 @@ struct EnableCoreXeHpcCore { populateFactoryTable>(); populateFactoryTable>(); populateFactoryTable>(); + populateFactoryTable>(); } }; diff --git a/shared/source/xe_hpg_core/debugger_xe_hpg_core.cpp b/shared/source/xe_hpg_core/debugger_xe_hpg_core.cpp new file mode 100644 index 0000000000..ef960187e4 --- /dev/null +++ b/shared/source/xe_hpg_core/debugger_xe_hpg_core.cpp @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2021-2022 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/debugger/debugger_l0.inl" +#include "shared/source/debugger/debugger_l0_tgllp_and_later.inl" +#include "shared/source/helpers/populate_factory.h" + +namespace NEO { + +using GfxFamily = NEO::XE_HPG_COREFamily; + +static auto coreFamily = IGFX_XE_HPG_CORE; + +template <> +void populateFactoryTable>() { + extern DebugerL0CreateFn debuggerL0Factory[IGFX_MAX_CORE]; + debuggerL0Factory[coreFamily] = DebuggerL0Hw::allocate; +} +template class DebuggerL0Hw; +} // namespace NEO \ No newline at end of file diff --git a/shared/source/xe_hpg_core/enable_family_full_core_xe_hpg_core.cpp b/shared/source/xe_hpg_core/enable_family_full_core_xe_hpg_core.cpp index 648a7f5502..3213ee19c6 100644 --- a/shared/source/xe_hpg_core/enable_family_full_core_xe_hpg_core.cpp +++ b/shared/source/xe_hpg_core/enable_family_full_core_xe_hpg_core.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -8,6 +8,7 @@ #include "shared/source/command_stream/aub_command_stream_receiver_hw.h" #include "shared/source/command_stream/command_stream_receiver_hw.h" #include "shared/source/command_stream/tbx_command_stream_receiver_hw.h" +#include "shared/source/debugger/debugger_l0.h" #include "shared/source/helpers/hw_helper.h" #include "shared/source/helpers/populate_factory.h" #include "shared/source/xe_hpg_core/hw_cmds.h" @@ -25,6 +26,7 @@ struct EnableCoreXeHpgCore { populateFactoryTable>(); populateFactoryTable>(); populateFactoryTable>(); + populateFactoryTable>(); } };