diff --git a/level_zero/core/source/printf_handler/printf_handler.cpp b/level_zero/core/source/printf_handler/printf_handler.cpp index 4b42140a04..ee87a3788b 100644 --- a/level_zero/core/source/printf_handler/printf_handler.cpp +++ b/level_zero/core/source/printf_handler/printf_handler.cpp @@ -8,6 +8,7 @@ #include "level_zero/core/source/printf_handler/printf_handler.h" #include "shared/source/command_stream/command_stream_receiver.h" +#include "shared/source/device/device.h" #include "shared/source/helpers/blit_properties.h" #include "shared/source/helpers/engine_node_helper.h" #include "shared/source/kernel/kernel_descriptor.h" diff --git a/level_zero/tools/source/debug/linux/debug_session.h b/level_zero/tools/source/debug/linux/debug_session.h index 7797a10677..07da116b05 100644 --- a/level_zero/tools/source/debug/linux/debug_session.h +++ b/level_zero/tools/source/debug/linux/debug_session.h @@ -7,6 +7,9 @@ #pragma once +#include "shared/source/device/device.h" +#include "shared/source/helpers/device_bitfield.h" +#include "shared/source/memory_manager/definitions/engine_limits.h" #include "shared/source/os_interface/linux/sys_calls.h" #include "level_zero/core/source/device/device.h" diff --git a/opencl/test/unit_test/windows/main_windows_dll.cpp b/opencl/test/unit_test/windows/main_windows_dll.cpp index 2f94253e6c..5e55968a36 100644 --- a/opencl/test/unit_test/windows/main_windows_dll.cpp +++ b/opencl/test/unit_test/windows/main_windows_dll.cpp @@ -6,15 +6,13 @@ */ #include "shared/source/execution_environment/root_device_environment.h" -#include "shared/source/helpers/hw_info.h" #include "shared/source/indirect_heap/heap_size.h" #include "shared/source/os_interface/os_interface.h" #include "shared/source/os_interface/windows/wddm/wddm.h" -#include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/source/utilities/buffer_pool_allocator.h" #include "shared/test/common/mocks/mock_execution_environment.h" -#include "shared/test/common/test_macros/hw_test.h" -#include +#include "gtest/gtest.h" using namespace NEO; diff --git a/shared/source/command_stream/aub_command_stream_receiver_hw_base.inl b/shared/source/command_stream/aub_command_stream_receiver_hw_base.inl index 8cffc50abb..e10812fb8d 100644 --- a/shared/source/command_stream/aub_command_stream_receiver_hw_base.inl +++ b/shared/source/command_stream/aub_command_stream_receiver_hw_base.inl @@ -10,37 +10,37 @@ #include "shared/source/aub/aub_subcapture.h" #include "shared/source/aub_mem_dump/aub_alloc_dump.h" #include "shared/source/aub_mem_dump/aub_alloc_dump.inl" -#include "shared/source/aub_mem_dump/page_table_entry_bits.h" #include "shared/source/command_stream/aub_command_stream_receiver_hw.h" #include "shared/source/command_stream/command_stream_receiver.h" #include "shared/source/command_stream/submission_status.h" #include "shared/source/command_stream/submissions_aggregator.h" +#include "shared/source/command_stream/task_count_helper.h" #include "shared/source/command_stream/wait_status.h" #include "shared/source/debug_settings/debug_settings_manager.h" #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" -#include "shared/source/helpers/aligned_memory.h" #include "shared/source/helpers/api_specific_config.h" #include "shared/source/helpers/constants.h" #include "shared/source/helpers/debug_helpers.h" #include "shared/source/helpers/engine_node_helper.h" #include "shared/source/helpers/flat_batch_buffer_helper.h" #include "shared/source/helpers/hash.h" -#include "shared/source/helpers/hw_info.h" +#include "shared/source/helpers/kmd_notify_properties.h" #include "shared/source/helpers/neo_driver_version.h" #include "shared/source/helpers/ptr_math.h" -#include "shared/source/helpers/string.h" #include "shared/source/helpers/string_helpers.h" #include "shared/source/memory_manager/graphics_allocation.h" -#include "shared/source/memory_manager/memory_banks.h" #include "shared/source/memory_manager/memory_manager.h" +#include "shared/source/memory_manager/memory_operations_handler.h" #include "shared/source/memory_manager/page_table.h" -#include "shared/source/os_interface/aub_memory_operations_handler.h" -#include "shared/source/os_interface/product_helper.h" +#include "shared/source/utilities/shared_pool_allocation.h" #include "aubstream/aubstream.h" -#include +#include +#include +#include +#include namespace NEO { diff --git a/shared/source/command_stream/tbx_command_stream_receiver_hw.inl b/shared/source/command_stream/tbx_command_stream_receiver_hw.inl index 7b7cc639dd..b25fb8fe25 100644 --- a/shared/source/command_stream/tbx_command_stream_receiver_hw.inl +++ b/shared/source/command_stream/tbx_command_stream_receiver_hw.inl @@ -9,31 +9,35 @@ #include "shared/source/aub/aub_helper.h" #include "shared/source/aub_mem_dump/aub_alloc_dump.h" #include "shared/source/aub_mem_dump/aub_alloc_dump.inl" -#include "shared/source/aub_mem_dump/page_table_entry_bits.h" #include "shared/source/command_stream/aub_command_stream_receiver.h" #include "shared/source/command_stream/command_stream_receiver_with_aub_dump.h" #include "shared/source/command_stream/submission_status.h" #include "shared/source/command_stream/submissions_aggregator.h" +#include "shared/source/command_stream/task_count_helper.h" #include "shared/source/command_stream/tbx_command_stream_receiver_hw.h" +#include "shared/source/command_stream/wait_status.h" #include "shared/source/debug_settings/debug_settings_manager.h" #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" -#include "shared/source/helpers/aligned_memory.h" #include "shared/source/helpers/api_specific_config.h" #include "shared/source/helpers/constants.h" #include "shared/source/helpers/debug_helpers.h" #include "shared/source/helpers/engine_node_helper.h" #include "shared/source/helpers/gfx_core_helper.h" -#include "shared/source/helpers/hw_info.h" +#include "shared/source/helpers/kmd_notify_properties.h" #include "shared/source/helpers/ptr_math.h" #include "shared/source/memory_manager/allocation_type.h" #include "shared/source/memory_manager/graphics_allocation.h" #include "shared/source/memory_manager/memory_manager.h" -#include "shared/source/os_interface/aub_memory_operations_handler.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/page_fault_manager/tbx_page_fault_manager.h" +#include "shared/source/memory_manager/memory_operations_handler.h" +#include "shared/source/page_fault_manager/cpu_page_fault_manager.h" +#include "shared/source/utilities/shared_pool_allocation.h" +#include +#include #include +#include +#include namespace NEO { diff --git a/shared/source/device/CMakeLists.txt b/shared/source/device/CMakeLists.txt index 026a65765b..b372337b97 100644 --- a/shared/source/device/CMakeLists.txt +++ b/shared/source/device/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2020-2022 Intel Corporation +# Copyright (C) 2020-2025 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -14,6 +14,7 @@ set(NEO_CORE_DEVICE ${CMAKE_CURRENT_SOURCE_DIR}/root_device.h ${CMAKE_CURRENT_SOURCE_DIR}/sub_device.cpp ${CMAKE_CURRENT_SOURCE_DIR}/sub_device.h + ${CMAKE_CURRENT_SOURCE_DIR}/sub_device_ids_vec.h ${CMAKE_CURRENT_SOURCE_DIR}/device_get_device_name.cpp ) if(WIN32) diff --git a/shared/source/device/sub_device.h b/shared/source/device/sub_device.h index c94d252032..184b104c23 100644 --- a/shared/source/device/sub_device.h +++ b/shared/source/device/sub_device.h @@ -7,12 +7,11 @@ #pragma once #include "shared/source/device/device.h" +#include "shared/source/device/sub_device_ids_vec.h" namespace NEO { - -using SubDeviceIdsVec = StackVec; - class RootDevice; + class SubDevice : public Device { public: SubDevice(ExecutionEnvironment *executionEnvironment, uint32_t subDeviceIndex, Device &rootDevice); diff --git a/shared/source/device/sub_device_ids_vec.h b/shared/source/device/sub_device_ids_vec.h new file mode 100644 index 0000000000..052466a41d --- /dev/null +++ b/shared/source/device/sub_device_ids_vec.h @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2025 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once +#include "shared/source/utilities/stackvec.h" + +#include + +namespace NEO { + +using SubDeviceIdsVec = StackVec; + +} // namespace NEO \ No newline at end of file diff --git a/shared/source/memory_manager/memory_manager.h b/shared/source/memory_manager/memory_manager.h index f26bae2674..795773dcd1 100644 --- a/shared/source/memory_manager/memory_manager.h +++ b/shared/source/memory_manager/memory_manager.h @@ -6,25 +6,37 @@ */ #pragma once -#include "shared/source/device/sub_device.h" +#include "shared/source/command_stream/task_count_helper.h" +#include "shared/source/device/sub_device_ids_vec.h" #include "shared/source/helpers/common_types.h" #include "shared/source/helpers/constants.h" +#include "shared/source/helpers/device_bitfield.h" #include "shared/source/helpers/engine_control.h" +#include "shared/source/helpers/engine_node_helper.h" #include "shared/source/helpers/heap_assigner.h" #include "shared/source/memory_manager/alignment_selector.h" +#include "shared/source/memory_manager/definitions/storage_info.h" #include "shared/source/memory_manager/graphics_allocation.h" +#include "shared/source/memory_manager/host_ptr_defines.h" #include "shared/source/memory_manager/memadvise_flags.h" #include "shared/source/memory_manager/unified_memory_reuse.h" #include "shared/source/os_interface/os_memory.h" +#include "shared/source/os_interface/product_helper.h" #include "shared/source/utilities/stackvec.h" #include "memory_properties_flags.h" +#include #include +#include +#include #include +#include #include #include +#include #include +#include #include namespace NEO { diff --git a/shared/source/os_interface/linux/drm_allocation.cpp b/shared/source/os_interface/linux/drm_allocation.cpp index 2aa5bc74f6..4be36e86de 100644 --- a/shared/source/os_interface/linux/drm_allocation.cpp +++ b/shared/source/os_interface/linux/drm_allocation.cpp @@ -29,6 +29,26 @@ namespace NEO { +DrmAllocation::DrmAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, BufferObject *bo, void *ptrIn, size_t sizeIn, osHandle sharedHandle, MemoryPool pool, uint64_t canonizedGpuAddress) + : GraphicsAllocation(rootDeviceIndex, numGmms, allocationType, ptrIn, sizeIn, sharedHandle, pool, MemoryManager::maxOsContextCount, canonizedGpuAddress) { + bufferObjects.push_back(bo); + resizeBufferObjects(EngineLimits::maxHandleCount); + handles.resize(EngineLimits::maxHandleCount, std::numeric_limits::max()); +} + +DrmAllocation::DrmAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, BufferObject *bo, void *ptrIn, uint64_t canonizedGpuAddress, size_t sizeIn, MemoryPool pool) + : GraphicsAllocation(rootDeviceIndex, numGmms, allocationType, ptrIn, canonizedGpuAddress, 0, sizeIn, pool, MemoryManager::maxOsContextCount) { + bufferObjects.push_back(bo); + resizeBufferObjects(EngineLimits::maxHandleCount); + handles.resize(EngineLimits::maxHandleCount, std::numeric_limits::max()); +} + +DrmAllocation::DrmAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, BufferObjects &bos, void *ptrIn, uint64_t canonizedGpuAddress, size_t sizeIn, MemoryPool pool) + : GraphicsAllocation(rootDeviceIndex, numGmms, allocationType, ptrIn, canonizedGpuAddress, 0, sizeIn, pool, MemoryManager::maxOsContextCount), + bufferObjects(bos) { + handles.resize(EngineLimits::maxHandleCount, std::numeric_limits::max()); +} + DrmAllocation::~DrmAllocation() { [[maybe_unused]] int retCode; for (auto &memory : this->memoryToUnmap) { diff --git a/shared/source/os_interface/linux/drm_allocation.h b/shared/source/os_interface/linux/drm_allocation.h index 6e0439ec84..0b7bd37efc 100644 --- a/shared/source/os_interface/linux/drm_allocation.h +++ b/shared/source/os_interface/linux/drm_allocation.h @@ -6,13 +6,15 @@ */ #pragma once +#include "shared/source/device/sub_device_ids_vec.h" #include "shared/source/memory_manager/graphics_allocation.h" #include "shared/source/memory_manager/memadvise_flags.h" -#include "shared/source/memory_manager/memory_manager.h" namespace NEO { class BufferObject; +class MemoryManager; class OsContext; +class ProductHelper; class Drm; class OsContextLinux; enum class CachePolicy : uint32_t; @@ -36,25 +38,9 @@ class DrmAllocation : public GraphicsAllocation { MemoryUnmapFunction unmapFunction; }; - DrmAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, BufferObject *bo, void *ptrIn, size_t sizeIn, osHandle sharedHandle, MemoryPool pool, uint64_t canonizedGpuAddress) - : GraphicsAllocation(rootDeviceIndex, numGmms, allocationType, ptrIn, sizeIn, sharedHandle, pool, MemoryManager::maxOsContextCount, canonizedGpuAddress) { - bufferObjects.push_back(bo); - resizeBufferObjects(EngineLimits::maxHandleCount); - handles.resize(EngineLimits::maxHandleCount, std::numeric_limits::max()); - } - - DrmAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, BufferObject *bo, void *ptrIn, uint64_t canonizedGpuAddress, size_t sizeIn, MemoryPool pool) - : GraphicsAllocation(rootDeviceIndex, numGmms, allocationType, ptrIn, canonizedGpuAddress, 0, sizeIn, pool, MemoryManager::maxOsContextCount) { - bufferObjects.push_back(bo); - resizeBufferObjects(EngineLimits::maxHandleCount); - handles.resize(EngineLimits::maxHandleCount, std::numeric_limits::max()); - } - - DrmAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, BufferObjects &bos, void *ptrIn, uint64_t canonizedGpuAddress, size_t sizeIn, MemoryPool pool) - : GraphicsAllocation(rootDeviceIndex, numGmms, allocationType, ptrIn, canonizedGpuAddress, 0, sizeIn, pool, MemoryManager::maxOsContextCount), - bufferObjects(bos) { - handles.resize(EngineLimits::maxHandleCount, std::numeric_limits::max()); - } + DrmAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, BufferObject *bo, void *ptrIn, size_t sizeIn, osHandle sharedHandle, MemoryPool pool, uint64_t canonizedGpuAddress); + DrmAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, BufferObject *bo, void *ptrIn, uint64_t canonizedGpuAddress, size_t sizeIn, MemoryPool pool); + DrmAllocation(uint32_t rootDeviceIndex, size_t numGmms, AllocationType allocationType, BufferObjects &bos, void *ptrIn, uint64_t canonizedGpuAddress, size_t sizeIn, MemoryPool pool); ~DrmAllocation() override; diff --git a/shared/source/os_interface/linux/ioctl_helper_i915.cpp b/shared/source/os_interface/linux/ioctl_helper_i915.cpp index 9000076961..1033c4a947 100644 --- a/shared/source/os_interface/linux/ioctl_helper_i915.cpp +++ b/shared/source/os_interface/linux/ioctl_helper_i915.cpp @@ -13,6 +13,7 @@ #include "shared/source/helpers/hw_info.h" #include "shared/source/helpers/ptr_math.h" #include "shared/source/helpers/register_offsets.h" +#include "shared/source/memory_manager/memory_manager.h" #include "shared/source/os_interface/linux/drm_neo.h" #include "shared/source/os_interface/linux/drm_wrappers.h" #include "shared/source/os_interface/linux/engine_info.h" diff --git a/shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp b/shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp index b3d6812652..2b8d3e188f 100644 --- a/shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp +++ b/shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp @@ -7,7 +7,6 @@ #include "shared/source/os_interface/linux/xe/ioctl_helper_xe.h" -#include "shared/source/debugger/debugger.h" #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/gmm_helper/client_context/gmm_client_context.h" @@ -16,16 +15,13 @@ #include "shared/source/helpers/basic_math.h" #include "shared/source/helpers/common_types.h" #include "shared/source/helpers/constants.h" -#include "shared/source/helpers/engine_control.h" -#include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/helpers/hw_info.h" #include "shared/source/helpers/ptr_math.h" -#include "shared/source/helpers/string.h" #include "shared/source/helpers/topology.h" +#include "shared/source/memory_manager/memory_manager.h" #include "shared/source/os_interface/linux/drm_buffer_object.h" #include "shared/source/os_interface/linux/drm_neo.h" #include "shared/source/os_interface/linux/engine_info.h" -#include "shared/source/os_interface/linux/file_descriptor.h" #include "shared/source/os_interface/linux/memory_info.h" #include "shared/source/os_interface/linux/os_context_linux.h" #include "shared/source/os_interface/linux/sys_calls.h" @@ -37,6 +33,7 @@ #include #include #include +#include #define STRINGIFY_ME(X) return #X #define RETURN_ME(X) return X diff --git a/shared/test/common/mocks/mock_l0_debugger.h b/shared/test/common/mocks/mock_l0_debugger.h index 609647ec1d..7ba7a9f788 100644 --- a/shared/test/common/mocks/mock_l0_debugger.h +++ b/shared/test/common/mocks/mock_l0_debugger.h @@ -7,6 +7,7 @@ #pragma once #include "shared/source/debugger/debugger_l0.h" +#include "shared/source/device/device.h" #include "shared/source/kernel/debug_data.h" extern NEO::DebugerL0CreateFn mockDebuggerL0HwFactory[];