From dfc50f3a75ffff4656a567c1673fb8ec83743100 Mon Sep 17 00:00:00 2001 From: "Dunajski, Bartosz" Date: Wed, 4 Dec 2019 12:36:16 +0100 Subject: [PATCH] Move gmm_helper to core Change-Id: I31ca317d10697ab884e04f443c8ccfdd6ca9d2ae Signed-off-by: Dunajski, Bartosz --- core/gmm_helper/CMakeLists.txt | 2 ++ {runtime => core}/gmm_helper/gmm_helper.cpp | 12 +++--------- {runtime => core}/gmm_helper/gmm_helper.h | 3 +-- core/helpers/hw_helper_base.inl | 2 +- core/helpers/hw_helper_bdw_plus.inl | 2 +- runtime/aub_mem_dump/aub_alloc_dump.inl | 2 +- ...mand_stream_receiver_simulated_common_hw_base.inl | 2 +- runtime/dll/linux/drm_neo_create.cpp | 2 +- .../execution_environment/execution_environment.cpp | 2 +- runtime/gmm_helper/CMakeLists.txt | 2 -- .../client_context/gmm_client_context_base.cpp | 1 + runtime/gmm_helper/gmm.cpp | 7 ++++--- runtime/gmm_helper/gmm_interface.cpp | 2 +- runtime/gmm_helper/gmm_memory_base.cpp | 5 +++-- runtime/gmm_helper/page_table_mngr_impl.cpp | 5 +++-- runtime/gmm_helper/resource_info_impl.cpp | 9 +++++---- runtime/helpers/state_base_address_base.inl | 2 +- runtime/kernel/kernel.cpp | 2 +- runtime/mem_obj/buffer.cpp | 2 +- runtime/mem_obj/image.inl | 2 +- .../memory_manager/os_agnostic_memory_manager.cpp | 2 +- runtime/os_interface/linux/drm_memory_manager.cpp | 2 +- runtime/os_interface/windows/wddm/wddm.cpp | 2 +- runtime/os_interface/windows/wddm_memory_manager.cpp | 2 +- runtime/platform/platform.cpp | 10 ++++++++++ runtime/platform/platform.h | 6 +++++- runtime/sharings/gl/gl_texture.cpp | 2 +- .../api/cl_mem_locally_uncached_resource_tests.cpp | 2 +- unit_tests/aub_mem_dump/aub_alloc_dump_tests.cpp | 2 +- unit_tests/built_ins/built_in_tests.cpp | 2 +- .../command_queue/enqueue_read_buffer_tests.cpp | 2 +- .../command_stream_receiver_flush_task_1_tests.cpp | 2 +- .../command_stream_receiver_flush_task_2_tests.cpp | 2 +- .../execution_environment_tests.cpp | 2 +- .../fixtures/ult_command_stream_receiver_fixture.h | 2 +- unit_tests/gen12lp/image_tests_gen12lp.inl | 5 +++-- unit_tests/gmm_helper/gmm_helper_tests.cpp | 8 ++++---- unit_tests/gmm_helper/gmm_interface_tests.cpp | 4 ++-- unit_tests/helpers/hw_helper_tests.cpp | 2 +- unit_tests/kernel/kernel_tests.cpp | 2 +- unit_tests/main.cpp | 2 +- unit_tests/mem_obj/buffer_set_arg_tests.cpp | 2 +- unit_tests/mem_obj/buffer_tests.cpp | 2 +- unit_tests/mem_obj/image_set_arg_tests.cpp | 2 +- .../os_interface/linux/drm_memory_manager_tests.cpp | 2 +- unit_tests/os_interface/windows/gmm_memory_tests.cpp | 7 ++++--- unit_tests/os_interface/windows/wddm20_tests.cpp | 2 +- .../windows/wddm_kmdaf_listener_tests.cpp | 2 +- .../windows/wddm_memory_manager_tests.cpp | 2 +- unit_tests/program/program_tests.cpp | 2 +- 50 files changed, 85 insertions(+), 71 deletions(-) rename {runtime => core}/gmm_helper/gmm_helper.cpp (76%) rename {runtime => core}/gmm_helper/gmm_helper.h (93%) diff --git a/core/gmm_helper/CMakeLists.txt b/core/gmm_helper/CMakeLists.txt index ca34c5cda8..a4685c765b 100644 --- a/core/gmm_helper/CMakeLists.txt +++ b/core/gmm_helper/CMakeLists.txt @@ -6,6 +6,8 @@ set(NEO_CORE_GMM_HELPER ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/gmm_helper.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/gmm_helper.h ${CMAKE_CURRENT_SOURCE_DIR}/gmm_lib.h ) diff --git a/runtime/gmm_helper/gmm_helper.cpp b/core/gmm_helper/gmm_helper.cpp similarity index 76% rename from runtime/gmm_helper/gmm_helper.cpp rename to core/gmm_helper/gmm_helper.cpp index d46e7f08b2..ec892b54b5 100644 --- a/runtime/gmm_helper/gmm_helper.cpp +++ b/core/gmm_helper/gmm_helper.cpp @@ -5,32 +5,26 @@ * */ -#include "runtime/gmm_helper/gmm_helper.h" +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/debug_helpers.h" #include "core/helpers/hw_info.h" #include "core/memory_manager/graphics_allocation.h" #include "core/os_interface/os_library.h" #include "core/sku_info/operations/sku_info_transfer.h" -#include "runtime/execution_environment/execution_environment.h" -#include "runtime/platform/platform.h" #include "gmm_client_context.h" namespace NEO { -GmmClientContext *GmmHelper::getClientContext() { - return getInstance()->gmmClientContext.get(); +GmmClientContext *GmmHelper::getClientContext() const { + return gmmClientContext.get(); } const HardwareInfo *GmmHelper::getHardwareInfo() { return hwInfo; } -GmmHelper *GmmHelper::getInstance() { - return platform()->peekExecutionEnvironment()->getGmmHelper(); -} - uint32_t GmmHelper::getMOCS(uint32_t type) { MEMORY_OBJECT_CONTROL_STATE mocs = gmmClientContext->cachePolicyGetMemoryObject(nullptr, static_cast(type)); diff --git a/runtime/gmm_helper/gmm_helper.h b/core/gmm_helper/gmm_helper.h similarity index 93% rename from runtime/gmm_helper/gmm_helper.h rename to core/gmm_helper/gmm_helper.h index 0d82b72d1c..fcb52cb1d8 100644 --- a/runtime/gmm_helper/gmm_helper.h +++ b/core/gmm_helper/gmm_helper.h @@ -37,8 +37,7 @@ class GmmHelper { return (address & maxNBitValue(addressWidth)); } - static GmmClientContext *getClientContext(); - static GmmHelper *getInstance(); + GmmClientContext *getClientContext() const; static std::unique_ptr (*createGmmContextWrapperFunc)(HardwareInfo *, decltype(&InitializeGmm), decltype(&GmmDestroy)); diff --git a/core/helpers/hw_helper_base.inl b/core/helpers/hw_helper_base.inl index 53390890be..e767465cb6 100644 --- a/core/helpers/hw_helper_base.inl +++ b/core/helpers/hw_helper_base.inl @@ -5,6 +5,7 @@ * */ +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/aligned_memory.h" #include "core/helpers/hw_helper.h" #include "core/helpers/hw_info.h" @@ -14,7 +15,6 @@ #include "runtime/aub_mem_dump/aub_mem_dump.h" #include "runtime/execution_environment/execution_environment.h" #include "runtime/gmm_helper/gmm.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/helpers/dispatch_info.h" #include "runtime/helpers/hardware_commands_helper.h" #include "runtime/os_interface/os_interface.h" diff --git a/core/helpers/hw_helper_bdw_plus.inl b/core/helpers/hw_helper_bdw_plus.inl index 49f5238a31..dab7b9e63d 100644 --- a/core/helpers/hw_helper_bdw_plus.inl +++ b/core/helpers/hw_helper_bdw_plus.inl @@ -5,8 +5,8 @@ * */ +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/hw_helper_base.inl" -#include "runtime/gmm_helper/gmm_helper.h" namespace NEO { diff --git a/runtime/aub_mem_dump/aub_alloc_dump.inl b/runtime/aub_mem_dump/aub_alloc_dump.inl index d847bc0845..163af19107 100644 --- a/runtime/aub_mem_dump/aub_alloc_dump.inl +++ b/runtime/aub_mem_dump/aub_alloc_dump.inl @@ -5,9 +5,9 @@ * */ +#include "core/gmm_helper/gmm_helper.h" #include "runtime/aub_mem_dump/aub_alloc_dump.h" #include "runtime/gmm_helper/gmm.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "third_party/aub_stream/headers/aubstream.h" diff --git a/runtime/command_stream/command_stream_receiver_simulated_common_hw_base.inl b/runtime/command_stream/command_stream_receiver_simulated_common_hw_base.inl index 2f4d429ce5..e6bac301b4 100644 --- a/runtime/command_stream/command_stream_receiver_simulated_common_hw_base.inl +++ b/runtime/command_stream/command_stream_receiver_simulated_common_hw_base.inl @@ -5,11 +5,11 @@ * */ +#include "core/gmm_helper/gmm_helper.h" #include "runtime/aub/aub_helper.h" #include "runtime/aub_mem_dump/page_table_entry_bits.h" #include "runtime/command_stream/command_stream_receiver_simulated_common_hw.h" #include "runtime/gmm_helper/gmm.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/gmm_helper/resource_info.h" #include "runtime/helpers/hardware_context_controller.h" #include "runtime/memory_manager/address_mapper.h" diff --git a/runtime/dll/linux/drm_neo_create.cpp b/runtime/dll/linux/drm_neo_create.cpp index dbc2b03691..bd92ed98ef 100644 --- a/runtime/dll/linux/drm_neo_create.cpp +++ b/runtime/dll/linux/drm_neo_create.cpp @@ -5,10 +5,10 @@ * */ +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/hw_cmds.h" #include "core/helpers/hw_helper.h" #include "core/helpers/hw_info.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/helpers/options.h" #include "runtime/os_interface/debug_settings_manager.h" #include "runtime/os_interface/linux/drm_neo.h" diff --git a/runtime/execution_environment/execution_environment.cpp b/runtime/execution_environment/execution_environment.cpp index 22d5725da9..c5dff6b791 100644 --- a/runtime/execution_environment/execution_environment.cpp +++ b/runtime/execution_environment/execution_environment.cpp @@ -9,12 +9,12 @@ #include "core/compiler_interface/compiler_interface.h" #include "core/execution_environment/root_device_environment.h" +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/hw_helper.h" #include "core/memory_manager/memory_operations_handler.h" #include "runtime/built_ins/built_ins.h" #include "runtime/command_stream/tbx_command_stream_receiver_hw.h" #include "runtime/compiler_interface/default_cl_cache_config.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/memory_manager/memory_manager.h" #include "runtime/os_interface/os_interface.h" #include "runtime/source_level_debugger/source_level_debugger.h" diff --git a/runtime/gmm_helper/CMakeLists.txt b/runtime/gmm_helper/CMakeLists.txt index f03ac0cd2f..16269ecd55 100644 --- a/runtime/gmm_helper/CMakeLists.txt +++ b/runtime/gmm_helper/CMakeLists.txt @@ -12,8 +12,6 @@ set(RUNTIME_SRCS_GMM_HELPER_BASE ${CMAKE_CURRENT_SOURCE_DIR}/client_context/gmm_client_context_base.h ${CMAKE_CURRENT_SOURCE_DIR}/client_context${BRANCH_DIR_SUFFIX}/gmm_client_context.cpp ${CMAKE_CURRENT_SOURCE_DIR}/client_context${BRANCH_DIR_SUFFIX}/gmm_client_context.h - ${CMAKE_CURRENT_SOURCE_DIR}/gmm_helper.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/gmm_helper.h ${CMAKE_CURRENT_SOURCE_DIR}/gmm_interface.cpp ${CMAKE_CURRENT_SOURCE_DIR}/gmm_types_converter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/gmm_types_converter.h diff --git a/runtime/gmm_helper/client_context/gmm_client_context_base.cpp b/runtime/gmm_helper/client_context/gmm_client_context_base.cpp index 5fd4875722..701a80bdd3 100644 --- a/runtime/gmm_helper/client_context/gmm_client_context_base.cpp +++ b/runtime/gmm_helper/client_context/gmm_client_context_base.cpp @@ -7,6 +7,7 @@ #include "runtime/gmm_helper/client_context/gmm_client_context_base.h" +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/debug_helpers.h" #include "core/helpers/hw_info.h" #include "core/sku_info/operations/sku_info_transfer.h" diff --git a/runtime/gmm_helper/gmm.cpp b/runtime/gmm_helper/gmm.cpp index a343774623..ca105447b0 100644 --- a/runtime/gmm_helper/gmm.cpp +++ b/runtime/gmm_helper/gmm.cpp @@ -7,14 +7,15 @@ #include "runtime/gmm_helper/gmm.h" +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/aligned_memory.h" #include "core/helpers/debug_helpers.h" #include "core/helpers/hw_helper.h" #include "core/helpers/hw_info.h" #include "core/helpers/ptr_math.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/gmm_helper/resource_info.h" #include "runtime/helpers/surface_formats.h" +#include "runtime/platform/platform.h" namespace NEO { Gmm::Gmm(const void *alignedPtr, size_t alignedSize, bool uncacheable) : Gmm(alignedPtr, alignedSize, uncacheable, false, true, {}) {} @@ -99,7 +100,7 @@ void Gmm::setupImageResourceParams(ImageInfo &imgInfo) { resourceParams.Flags.Info.Linear = imgInfo.linearStorage; - auto &hwHelper = HwHelper::get(GmmHelper::getInstance()->getHardwareInfo()->platform.eRenderCoreFamily); + auto &hwHelper = HwHelper::get(platform()->peekGmmHelper()->getHardwareInfo()->platform.eRenderCoreFamily); resourceParams.NoGfxMemory = 1; // dont allocate, only query for params @@ -176,7 +177,7 @@ void Gmm::queryImageParams(ImageInfo &imgInfo) { } uint32_t Gmm::queryQPitch(GMM_RESOURCE_TYPE resType) { - if (GmmHelper::getInstance()->getHardwareInfo()->platform.eRenderCoreFamily == IGFX_GEN8_CORE && resType == GMM_RESOURCE_TYPE::RESOURCE_3D) { + if (platform()->peekGmmHelper()->getHardwareInfo()->platform.eRenderCoreFamily == IGFX_GEN8_CORE && resType == GMM_RESOURCE_TYPE::RESOURCE_3D) { return 0; } return gmmResourceInfo->getQPitch(); diff --git a/runtime/gmm_helper/gmm_interface.cpp b/runtime/gmm_helper/gmm_interface.cpp index d765b8f4ca..1902d77cdc 100644 --- a/runtime/gmm_helper/gmm_interface.cpp +++ b/runtime/gmm_helper/gmm_interface.cpp @@ -5,9 +5,9 @@ * */ +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/debug_helpers.h" #include "core/os_interface/os_library.h" -#include "runtime/gmm_helper/gmm_helper.h" namespace Os { extern const char *gmmDllName; diff --git a/runtime/gmm_helper/gmm_memory_base.cpp b/runtime/gmm_helper/gmm_memory_base.cpp index 79762cb77a..2c56ed4ec1 100644 --- a/runtime/gmm_helper/gmm_memory_base.cpp +++ b/runtime/gmm_helper/gmm_memory_base.cpp @@ -7,14 +7,15 @@ #include "runtime/gmm_helper/gmm_memory_base.h" -#include "runtime/gmm_helper/gmm_helper.h" +#include "core/gmm_helper/gmm_helper.h" #include "runtime/os_interface/windows/windows_defs.h" +#include "runtime/platform/platform.h" #include "gmm_client_context.h" namespace NEO { GmmMemoryBase::GmmMemoryBase() { - clientContext = GmmHelper::getClientContext()->getHandle(); + clientContext = platform()->peekGmmHelper()->getClientContext()->getHandle(); } bool GmmMemoryBase::configureDeviceAddressSpace(GMM_ESCAPE_HANDLE hAdapter, GMM_ESCAPE_HANDLE hDevice, diff --git a/runtime/gmm_helper/page_table_mngr_impl.cpp b/runtime/gmm_helper/page_table_mngr_impl.cpp index 68daa006f2..15f2041fae 100644 --- a/runtime/gmm_helper/page_table_mngr_impl.cpp +++ b/runtime/gmm_helper/page_table_mngr_impl.cpp @@ -5,8 +5,9 @@ * */ -#include "runtime/gmm_helper/gmm_helper.h" +#include "core/gmm_helper/gmm_helper.h" #include "runtime/gmm_helper/page_table_mngr.h" +#include "runtime/platform/platform.h" #include "gmm_client_context.h" @@ -18,7 +19,7 @@ GmmPageTableMngr::~GmmPageTableMngr() { } GmmPageTableMngr::GmmPageTableMngr(unsigned int translationTableFlags, GMM_TRANSLATIONTABLE_CALLBACKS *translationTableCb) { - clientContext = GmmHelper::getClientContext()->getHandle(); + clientContext = platform()->peekGmmClientContext()->getHandle(); pageTableManager = clientContext->CreatePageTblMgrObject(translationTableCb, translationTableFlags); } diff --git a/runtime/gmm_helper/resource_info_impl.cpp b/runtime/gmm_helper/resource_info_impl.cpp index 741e97c772..7d97aa10fc 100644 --- a/runtime/gmm_helper/resource_info_impl.cpp +++ b/runtime/gmm_helper/resource_info_impl.cpp @@ -5,25 +5,26 @@ * */ -#include "runtime/gmm_helper/gmm_helper.h" +#include "core/gmm_helper/gmm_helper.h" #include "runtime/gmm_helper/resource_info.h" +#include "runtime/platform/platform.h" #include "gmm_client_context.h" namespace NEO { GmmResourceInfo::GmmResourceInfo(GMM_RESCREATE_PARAMS *resourceCreateParams) { - auto resourceInfoPtr = GmmHelper::getClientContext()->createResInfoObject(resourceCreateParams); + auto resourceInfoPtr = platform()->peekGmmClientContext()->createResInfoObject(resourceCreateParams); createResourceInfo(resourceInfoPtr); } GmmResourceInfo::GmmResourceInfo(GMM_RESOURCE_INFO *inputGmmResourceInfo) { - auto resourceInfoPtr = GmmHelper::getClientContext()->copyResInfoObject(inputGmmResourceInfo); + auto resourceInfoPtr = platform()->peekGmmClientContext()->copyResInfoObject(inputGmmResourceInfo); createResourceInfo(resourceInfoPtr); } void GmmResourceInfo::createResourceInfo(GMM_RESOURCE_INFO *resourceInfoPtr) { - auto gmmClientContext = GmmHelper::getClientContext(); + auto gmmClientContext = platform()->peekGmmClientContext(); auto customDeleter = [gmmClientContext](GMM_RESOURCE_INFO *gmmResourceInfo) { gmmClientContext->destroyResInfoObject(gmmResourceInfo); }; diff --git a/runtime/helpers/state_base_address_base.inl b/runtime/helpers/state_base_address_base.inl index 70830dabf7..a650d31770 100644 --- a/runtime/helpers/state_base_address_base.inl +++ b/runtime/helpers/state_base_address_base.inl @@ -5,11 +5,11 @@ * */ +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/cache_policy.h" #include "core/helpers/hw_cmds.h" #include "core/indirect_heap/indirect_heap.h" #include "core/memory_manager/memory_constants.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/helpers/state_base_address.h" namespace NEO { diff --git a/runtime/kernel/kernel.cpp b/runtime/kernel/kernel.cpp index aba2c954b9..8fad647bb5 100644 --- a/runtime/kernel/kernel.cpp +++ b/runtime/kernel/kernel.cpp @@ -7,6 +7,7 @@ #include "runtime/kernel/kernel.h" +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/aligned_memory.h" #include "core/helpers/basic_math.h" #include "core/helpers/debug_helpers.h" @@ -23,7 +24,6 @@ #include "runtime/context/context.h" #include "runtime/device_queue/device_queue.h" #include "runtime/execution_model/device_enqueue.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/gtpin/gtpin_notify.h" #include "runtime/helpers/get_info.h" #include "runtime/helpers/per_thread_data.h" diff --git a/runtime/mem_obj/buffer.cpp b/runtime/mem_obj/buffer.cpp index 282ccefa4c..3ba98cf079 100644 --- a/runtime/mem_obj/buffer.cpp +++ b/runtime/mem_obj/buffer.cpp @@ -7,6 +7,7 @@ #include "runtime/mem_obj/buffer.h" +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/aligned_memory.h" #include "core/helpers/hw_helper.h" #include "core/helpers/hw_info.h" @@ -19,7 +20,6 @@ #include "runtime/context/context.h" #include "runtime/device/device.h" #include "runtime/gmm_helper/gmm.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/helpers/memory_properties_flags_helpers.h" #include "runtime/helpers/timestamp_packet.h" #include "runtime/helpers/validators.h" diff --git a/runtime/mem_obj/image.inl b/runtime/mem_obj/image.inl index 2b1c40f5ee..a3dfa874ea 100644 --- a/runtime/mem_obj/image.inl +++ b/runtime/mem_obj/image.inl @@ -5,11 +5,11 @@ * */ +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/aligned_memory.h" #include "core/helpers/hw_cmds.h" #include "runtime/execution_environment/execution_environment.h" #include "runtime/gmm_helper/gmm.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/gmm_helper/resource_info.h" #include "runtime/helpers/surface_formats.h" #include "runtime/mem_obj/image.h" diff --git a/runtime/memory_manager/os_agnostic_memory_manager.cpp b/runtime/memory_manager/os_agnostic_memory_manager.cpp index a02d077568..89fe3f37a9 100644 --- a/runtime/memory_manager/os_agnostic_memory_manager.cpp +++ b/runtime/memory_manager/os_agnostic_memory_manager.cpp @@ -8,6 +8,7 @@ #include "runtime/memory_manager/os_agnostic_memory_manager.h" #include "core/execution_environment/root_device_environment.h" +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/aligned_memory.h" #include "core/helpers/basic_math.h" #include "core/helpers/hw_info.h" @@ -17,7 +18,6 @@ #include "runtime/aub/aub_center.h" #include "runtime/execution_environment/execution_environment.h" #include "runtime/gmm_helper/gmm.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/gmm_helper/resource_info.h" #include "runtime/helpers/options.h" #include "runtime/helpers/surface_formats.h" diff --git a/runtime/os_interface/linux/drm_memory_manager.cpp b/runtime/os_interface/linux/drm_memory_manager.cpp index 4864e0c6db..7bbb53f229 100644 --- a/runtime/os_interface/linux/drm_memory_manager.cpp +++ b/runtime/os_interface/linux/drm_memory_manager.cpp @@ -7,6 +7,7 @@ #include "runtime/os_interface/linux/drm_memory_manager.h" +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/hw_info.h" #include "core/helpers/ptr_math.h" #include "core/memory_manager/host_ptr_manager.h" @@ -14,7 +15,6 @@ #include "runtime/device/device.h" #include "runtime/execution_environment/execution_environment.h" #include "runtime/gmm_helper/gmm.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/gmm_helper/resource_info.h" #include "runtime/helpers/options.h" #include "runtime/helpers/surface_formats.h" diff --git a/runtime/os_interface/windows/wddm/wddm.cpp b/runtime/os_interface/windows/wddm/wddm.cpp index 93f83a872b..f4b054710f 100644 --- a/runtime/os_interface/windows/wddm/wddm.cpp +++ b/runtime/os_interface/windows/wddm/wddm.cpp @@ -8,13 +8,13 @@ #include "runtime/os_interface/windows/wddm/wddm.h" #include "core/command_stream/preemption.h" +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/interlocked_max.h" #include "core/os_interface/windows/debug_registry_reader.h" #include "core/sku_info/operations/windows/sku_info_receiver.h" #include "core/utilities/stackvec.h" #include "runtime/execution_environment/execution_environment.h" #include "runtime/gmm_helper/gmm.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/gmm_helper/page_table_mngr.h" #include "runtime/gmm_helper/resource_info.h" #include "runtime/memory_manager/memory_manager.h" diff --git a/runtime/os_interface/windows/wddm_memory_manager.cpp b/runtime/os_interface/windows/wddm_memory_manager.cpp index 8358c1d815..61e87bf941 100644 --- a/runtime/os_interface/windows/wddm_memory_manager.cpp +++ b/runtime/os_interface/windows/wddm_memory_manager.cpp @@ -7,6 +7,7 @@ #include "runtime/os_interface/windows/wddm_memory_manager.h" +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/aligned_memory.h" #include "core/helpers/deferred_deleter_helper.h" #include "core/helpers/ptr_math.h" @@ -16,7 +17,6 @@ #include "runtime/device/device.h" #include "runtime/execution_environment/execution_environment.h" #include "runtime/gmm_helper/gmm.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/gmm_helper/resource_info.h" #include "runtime/helpers/surface_formats.h" #include "runtime/memory_manager/deferrable_deletion.h" diff --git a/runtime/platform/platform.cpp b/runtime/platform/platform.cpp index 859f24abe0..825ab33b07 100644 --- a/runtime/platform/platform.cpp +++ b/runtime/platform/platform.cpp @@ -9,6 +9,7 @@ #include "core/compiler_interface/compiler_interface.h" #include "core/execution_environment/root_device_environment.h" +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/debug_helpers.h" #include "core/helpers/hw_helper.h" #include "core/helpers/string.h" @@ -29,6 +30,7 @@ #include "runtime/source_level_debugger/source_level_debugger.h" #include "CL/cl_ext.h" +#include "gmm_client_context.h" namespace NEO { @@ -253,4 +255,12 @@ RootDevice *Platform::createRootDevice(uint32_t rootDeviceIndex) const { return Device::create(executionEnvironment, rootDeviceIndex); } +GmmHelper *Platform::peekGmmHelper() const { + return executionEnvironment->getGmmHelper(); +} + +GmmClientContext *Platform::peekGmmClientContext() const { + return peekGmmHelper()->getClientContext(); +} + } // namespace NEO diff --git a/runtime/platform/platform.h b/runtime/platform/platform.h index 8fac750f10..36286f51e3 100644 --- a/runtime/platform/platform.h +++ b/runtime/platform/platform.h @@ -22,6 +22,8 @@ class RootDevice; class Device; class AsyncEventsHandler; class ExecutionEnvironment; +class GmmHelper; +class GmmClientContext; struct HardwareInfo; template <> @@ -56,7 +58,9 @@ class Platform : public BaseObject<_cl_platform_id> { const PlatformInfo &getPlatformInfo() const; AsyncEventsHandler *getAsyncEventsHandler(); std::unique_ptr setAsyncEventsHandler(std::unique_ptr handler); - ExecutionEnvironment *peekExecutionEnvironment() { return executionEnvironment; } + ExecutionEnvironment *peekExecutionEnvironment() const { return executionEnvironment; } + GmmHelper *peekGmmHelper() const; + GmmClientContext *peekGmmClientContext() const; protected: enum { diff --git a/runtime/sharings/gl/gl_texture.cpp b/runtime/sharings/gl/gl_texture.cpp index abc6dd556c..20adc15c03 100644 --- a/runtime/sharings/gl/gl_texture.cpp +++ b/runtime/sharings/gl/gl_texture.cpp @@ -7,13 +7,13 @@ #include "runtime/sharings/gl/gl_texture.h" +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/hw_helper.h" #include "core/helpers/hw_info.h" #include "public/cl_gl_private_intel.h" #include "runtime/context/context.h" #include "runtime/device/device.h" #include "runtime/gmm_helper/gmm.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/gmm_helper/gmm_types_converter.h" #include "runtime/gmm_helper/resource_info.h" #include "runtime/helpers/get_info.h" diff --git a/unit_tests/api/cl_mem_locally_uncached_resource_tests.cpp b/unit_tests/api/cl_mem_locally_uncached_resource_tests.cpp index 99569355e3..6b801d7549 100644 --- a/unit_tests/api/cl_mem_locally_uncached_resource_tests.cpp +++ b/unit_tests/api/cl_mem_locally_uncached_resource_tests.cpp @@ -5,6 +5,7 @@ * */ +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/hw_cmds.h" #include "core/unit_tests/utilities/base_object_utils.h" #include "public/cl_ext_private.h" @@ -12,7 +13,6 @@ #include "runtime/command_queue/command_queue_hw.h" #include "runtime/command_stream/command_stream_receiver.h" #include "runtime/device/device.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/helpers/state_base_address.h" #include "runtime/kernel/kernel.h" #include "test.h" diff --git a/unit_tests/aub_mem_dump/aub_alloc_dump_tests.cpp b/unit_tests/aub_mem_dump/aub_alloc_dump_tests.cpp index 0a51879044..7b8dce46b0 100644 --- a/unit_tests/aub_mem_dump/aub_alloc_dump_tests.cpp +++ b/unit_tests/aub_mem_dump/aub_alloc_dump_tests.cpp @@ -5,10 +5,10 @@ * */ +#include "core/gmm_helper/gmm_helper.h" #include "core/unit_tests/helpers/debug_manager_state_restore.h" #include "runtime/aub_mem_dump/aub_alloc_dump.h" #include "runtime/gmm_helper/gmm.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/mem_obj/buffer.h" #include "test.h" #include "unit_tests/fixtures/device_fixture.h" diff --git a/unit_tests/built_ins/built_in_tests.cpp b/unit_tests/built_ins/built_in_tests.cpp index 35365efa71..e74190ddce 100644 --- a/unit_tests/built_ins/built_in_tests.cpp +++ b/unit_tests/built_ins/built_in_tests.cpp @@ -5,6 +5,7 @@ * */ +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/file_io.h" #include "core/helpers/hash.h" #include "core/helpers/string.h" @@ -15,7 +16,6 @@ #include "runtime/built_ins/builtins_dispatch_builder.h" #include "runtime/built_ins/vme_dispatch_builder.h" #include "runtime/gmm_helper/gmm.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/helpers/dispatch_info_builder.h" #include "runtime/kernel/kernel.h" #include "runtime/os_interface/debug_settings_manager.h" diff --git a/unit_tests/command_queue/enqueue_read_buffer_tests.cpp b/unit_tests/command_queue/enqueue_read_buffer_tests.cpp index 68b5b984fa..b8ec08dd19 100644 --- a/unit_tests/command_queue/enqueue_read_buffer_tests.cpp +++ b/unit_tests/command_queue/enqueue_read_buffer_tests.cpp @@ -5,11 +5,11 @@ * */ +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/cache_policy.h" #include "core/unit_tests/helpers/debug_manager_state_restore.h" #include "runtime/built_ins/built_ins.h" #include "runtime/built_ins/builtins_dispatch_builder.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/helpers/dispatch_info.h" #include "runtime/memory_manager/allocations_list.h" #include "test.h" diff --git a/unit_tests/command_stream/command_stream_receiver_flush_task_1_tests.cpp b/unit_tests/command_stream/command_stream_receiver_flush_task_1_tests.cpp index 882c6b4c6f..cbe918238e 100644 --- a/unit_tests/command_stream/command_stream_receiver_flush_task_1_tests.cpp +++ b/unit_tests/command_stream/command_stream_receiver_flush_task_1_tests.cpp @@ -5,9 +5,9 @@ * */ +#include "core/gmm_helper/gmm_helper.h" #include "core/unit_tests/helpers/debug_manager_state_restore.h" #include "runtime/command_queue/gpgpu_walker.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/os_interface/os_context.h" #include "test.h" #include "unit_tests/fixtures/ult_command_stream_receiver_fixture.h" diff --git a/unit_tests/command_stream/command_stream_receiver_flush_task_2_tests.cpp b/unit_tests/command_stream/command_stream_receiver_flush_task_2_tests.cpp index e146cb82ea..315eae7dee 100644 --- a/unit_tests/command_stream/command_stream_receiver_flush_task_2_tests.cpp +++ b/unit_tests/command_stream/command_stream_receiver_flush_task_2_tests.cpp @@ -5,11 +5,11 @@ * */ +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/hw_helper.h" #include "core/unit_tests/helpers/debug_manager_state_restore.h" #include "runtime/command_stream/csr_definitions.h" #include "runtime/command_stream/scratch_space_controller.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/helpers/hardware_commands_helper.h" #include "runtime/helpers/state_base_address.h" #include "runtime/memory_manager/internal_allocation_storage.h" diff --git a/unit_tests/execution_environment/execution_environment_tests.cpp b/unit_tests/execution_environment/execution_environment_tests.cpp index c797d194bb..116a20a0b7 100644 --- a/unit_tests/execution_environment/execution_environment_tests.cpp +++ b/unit_tests/execution_environment/execution_environment_tests.cpp @@ -7,6 +7,7 @@ #include "core/command_stream/preemption.h" #include "core/compiler_interface/compiler_interface.h" +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/hw_helper.h" #include "core/unit_tests/helpers/debug_manager_state_restore.h" #include "core/unit_tests/utilities/destructor_counted.h" @@ -14,7 +15,6 @@ #include "runtime/built_ins/built_ins.h" #include "runtime/device/device.h" #include "runtime/execution_environment/execution_environment.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/helpers/options.h" #include "runtime/memory_manager/os_agnostic_memory_manager.h" #include "runtime/os_interface/os_interface.h" diff --git a/unit_tests/fixtures/ult_command_stream_receiver_fixture.h b/unit_tests/fixtures/ult_command_stream_receiver_fixture.h index 174fffdb96..9e9dd72d2b 100644 --- a/unit_tests/fixtures/ult_command_stream_receiver_fixture.h +++ b/unit_tests/fixtures/ult_command_stream_receiver_fixture.h @@ -8,10 +8,10 @@ #pragma once #include "core/command_stream/linear_stream.h" #include "core/command_stream/preemption.h" +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/cache_policy.h" #include "core/memory_manager/graphics_allocation.h" #include "runtime/command_stream/command_stream_receiver.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "unit_tests/fixtures/device_fixture.h" #include "unit_tests/helpers/dispatch_flags_helper.h" #include "unit_tests/helpers/hw_parse.h" diff --git a/unit_tests/gen12lp/image_tests_gen12lp.inl b/unit_tests/gen12lp/image_tests_gen12lp.inl index 2ccfa38ed2..93ecfa0479 100644 --- a/unit_tests/gen12lp/image_tests_gen12lp.inl +++ b/unit_tests/gen12lp/image_tests_gen12lp.inl @@ -5,8 +5,9 @@ * */ -#include "runtime/gmm_helper/gmm_helper.h" +#include "core/gmm_helper/gmm_helper.h" #include "runtime/memory_manager/memory_manager.h" +#include "runtime/platform/platform.h" #include "test.h" #include "unit_tests/fixtures/image_fixture.h" #include "unit_tests/gen12lp/special_ult_helper_gen12lp.h" @@ -148,7 +149,7 @@ GEN12LPTEST_F(gen12LpImageTests, givenCompressionEnabledWhenAppendingSurfaceStat rss.setMemoryCompressionEnable(true); MockContext context{}; std::unique_ptr image{static_cast(ImageHelper::create(&context))}; - MockGmmClientContext *gmmClientContext = static_cast(GmmHelper::getClientContext()); + MockGmmClientContext *gmmClientContext = static_cast(platform()->peekGmmClientContext()); uint8_t expectedCompressionFormat = rss.getCompressionFormat(); if (SpecialUltHelperGen12lp::isAdditionalSurfaceStateParamForCompressionRequired(context.getDevice(0)->getHardwareInfo())) { diff --git a/unit_tests/gmm_helper/gmm_helper_tests.cpp b/unit_tests/gmm_helper/gmm_helper_tests.cpp index 18eaf68095..e7db3fda76 100644 --- a/unit_tests/gmm_helper/gmm_helper_tests.cpp +++ b/unit_tests/gmm_helper/gmm_helper_tests.cpp @@ -5,11 +5,11 @@ * */ +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/hw_info.h" #include "core/helpers/ptr_math.h" #include "core/unit_tests/helpers/debug_manager_state_restore.h" #include "runtime/gmm_helper/gmm.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/gmm_helper/gmm_types_converter.h" #include "runtime/helpers/options.h" #include "runtime/memory_manager/os_agnostic_memory_manager.h" @@ -163,7 +163,7 @@ TEST_F(GmmTests, validImageTypeQuery) { EXPECT_GT(imgInfo.qPitch, 0u); } - auto &hwHelper = HwHelper::get(GmmHelper::getInstance()->getHardwareInfo()->platform.eRenderCoreFamily); + auto &hwHelper = HwHelper::get(hwinfo->platform.eRenderCoreFamily); EXPECT_EQ(queryGmm->resourceParams.Type, GMM_RESOURCE_TYPE::RESOURCE_3D); EXPECT_EQ(queryGmm->resourceParams.NoGfxMemory, 1u); @@ -676,8 +676,8 @@ TEST(GmmTest, givenGmmWithSetMCSInResourceInfoGpuFlagsWhenCallhasMultisampleCont } TEST(GmmHelperTest, whenGmmHelperIsInitializedThenClientContextIsSet) { - ASSERT_NE(nullptr, GmmHelper::getClientContext()); - EXPECT_NE(nullptr, GmmHelper::getClientContext()->getHandle()); + ASSERT_NE(nullptr, platform()->peekGmmClientContext()); + EXPECT_NE(nullptr, platform()->peekGmmClientContext()->getHandle()); } TEST(GmmHelperTest, givenPlatformAlreadyDestroyedWhenResourceIsBeingDestroyedThenObserveNoExceptions) { diff --git a/unit_tests/gmm_helper/gmm_interface_tests.cpp b/unit_tests/gmm_helper/gmm_interface_tests.cpp index 672b4847f0..d415489f24 100644 --- a/unit_tests/gmm_helper/gmm_interface_tests.cpp +++ b/unit_tests/gmm_helper/gmm_interface_tests.cpp @@ -5,10 +5,10 @@ * */ +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/hw_info.h" #include "core/sku_info/operations/sku_info_transfer.h" #include "runtime/execution_environment/execution_environment.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/os_interface/os_interface.h" #include "runtime/platform/platform.h" #include "unit_tests/helpers/variable_backup.h" @@ -143,4 +143,4 @@ TEST_F(GmmInterfaceTest, givenValidGmmFunctionsWhenCreateGmmHelperWithoutOsInter EXPECT_EQ(0, memcmp(&expectedFtrTable, &passedFtrTable, sizeof(SKU_FEATURE_TABLE))); EXPECT_EQ(0, memcmp(&expectedWaTable, &passedWaTable, sizeof(WA_TABLE))); EXPECT_EQ(GMM_CLIENT::GMM_OCL_VISTA, passedInputArgs.ClientType); -} \ No newline at end of file +} diff --git a/unit_tests/helpers/hw_helper_tests.cpp b/unit_tests/helpers/hw_helper_tests.cpp index 91ebe18bc9..175ed3f087 100644 --- a/unit_tests/helpers/hw_helper_tests.cpp +++ b/unit_tests/helpers/hw_helper_tests.cpp @@ -7,12 +7,12 @@ #include "unit_tests/helpers/hw_helper_tests.h" +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/aligned_memory.h" #include "core/helpers/string.h" #include "core/memory_manager/graphics_allocation.h" #include "core/unit_tests/helpers/debug_manager_state_restore.h" #include "runtime/gmm_helper/gmm.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/gmm_helper/resource_info.h" #include "runtime/helpers/dispatch_info.h" #include "runtime/helpers/hardware_commands_helper.h" diff --git a/unit_tests/kernel/kernel_tests.cpp b/unit_tests/kernel/kernel_tests.cpp index 77ec80201b..fd0cc92e0b 100644 --- a/unit_tests/kernel/kernel_tests.cpp +++ b/unit_tests/kernel/kernel_tests.cpp @@ -5,6 +5,7 @@ * */ +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/hw_helper.h" #include "core/memory_manager/unified_memory_manager.h" #include "core/unit_tests/helpers/debug_manager_state_restore.h" @@ -12,7 +13,6 @@ #include "core/unit_tests/utilities/base_object_utils.h" #include "runtime/built_ins/builtins_dispatch_builder.h" #include "runtime/command_stream/command_stream_receiver_hw.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/helpers/flush_stamp.h" #include "runtime/helpers/memory_properties_flags_helpers.h" #include "runtime/helpers/options.h" diff --git a/unit_tests/main.cpp b/unit_tests/main.cpp index a40f9b708f..b1a5ed7dbc 100644 --- a/unit_tests/main.cpp +++ b/unit_tests/main.cpp @@ -5,9 +5,9 @@ * */ +#include "core/gmm_helper/gmm_helper.h" #include "core/unit_tests/helpers/memory_leak_listener.h" #include "core/utilities/debug_settings_reader.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/gmm_helper/resource_info.h" #include "runtime/helpers/options.h" #include "runtime/os_interface/debug_settings_manager.h" diff --git a/unit_tests/mem_obj/buffer_set_arg_tests.cpp b/unit_tests/mem_obj/buffer_set_arg_tests.cpp index 79241426db..32ec5254b5 100644 --- a/unit_tests/mem_obj/buffer_set_arg_tests.cpp +++ b/unit_tests/mem_obj/buffer_set_arg_tests.cpp @@ -5,11 +5,11 @@ * */ +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/ptr_math.h" #include "core/memory_manager/unified_memory_manager.h" #include "core/unit_tests/helpers/debug_manager_state_restore.h" #include "runtime/gmm_helper/gmm.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/kernel/kernel.h" #include "runtime/memory_manager/surface.h" #include "test.h" diff --git a/unit_tests/mem_obj/buffer_tests.cpp b/unit_tests/mem_obj/buffer_tests.cpp index f66267da38..647940674d 100644 --- a/unit_tests/mem_obj/buffer_tests.cpp +++ b/unit_tests/mem_obj/buffer_tests.cpp @@ -5,6 +5,7 @@ * */ +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/hw_helper.h" #include "core/memory_manager/unified_memory_manager.h" #include "core/unit_tests/helpers/debug_manager_state_restore.h" @@ -14,7 +15,6 @@ #include "runtime/command_queue/gpgpu_walker.h" #include "runtime/event/user_event.h" #include "runtime/gmm_helper/gmm.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/gmm_helper/resource_info.h" #include "runtime/helpers/array_count.h" #include "runtime/helpers/memory_properties_flags_helpers.h" diff --git a/unit_tests/mem_obj/image_set_arg_tests.cpp b/unit_tests/mem_obj/image_set_arg_tests.cpp index ab53da24e6..2f3e72b9ea 100644 --- a/unit_tests/mem_obj/image_set_arg_tests.cpp +++ b/unit_tests/mem_obj/image_set_arg_tests.cpp @@ -5,12 +5,12 @@ * */ +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/aligned_memory.h" #include "core/helpers/basic_math.h" #include "core/helpers/ptr_math.h" #include "core/memory_manager/graphics_allocation.h" #include "runtime/gmm_helper/gmm.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/helpers/surface_formats.h" #include "runtime/kernel/kernel.h" #include "runtime/mem_obj/image.h" diff --git a/unit_tests/os_interface/linux/drm_memory_manager_tests.cpp b/unit_tests/os_interface/linux/drm_memory_manager_tests.cpp index b824a31335..0909004a5f 100644 --- a/unit_tests/os_interface/linux/drm_memory_manager_tests.cpp +++ b/unit_tests/os_interface/linux/drm_memory_manager_tests.cpp @@ -9,6 +9,7 @@ #include "core/command_stream/linear_stream.h" #include "core/command_stream/preemption.h" +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/aligned_memory.h" #include "core/helpers/ptr_math.h" #include "core/memory_manager/host_ptr_manager.h" @@ -16,7 +17,6 @@ #include "core/unit_tests/helpers/debug_manager_state_restore.h" #include "runtime/command_stream/device_command_stream.h" #include "runtime/event/event.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/helpers/memory_properties_flags_helpers.h" #include "runtime/helpers/timestamp_packet.h" #include "runtime/mem_obj/buffer.h" diff --git a/unit_tests/os_interface/windows/gmm_memory_tests.cpp b/unit_tests/os_interface/windows/gmm_memory_tests.cpp index 4abd400a9c..65c6f8c345 100644 --- a/unit_tests/os_interface/windows/gmm_memory_tests.cpp +++ b/unit_tests/os_interface/windows/gmm_memory_tests.cpp @@ -5,8 +5,9 @@ * */ -#include "runtime/gmm_helper/gmm_helper.h" +#include "core/gmm_helper/gmm_helper.h" #include "runtime/helpers/options.h" +#include "runtime/platform/platform.h" #include "gmm_client_context.h" #include "gmm_memory.h" @@ -19,7 +20,7 @@ class PublicGmmMemory : public GmmMemory { }; TEST(GmmMemoryTest, givenGmmHelperWhenCreateGmmMemoryThenItHasClientContextFromGmmHelper) { - ASSERT_NE(nullptr, GmmHelper::getClientContext()); + ASSERT_NE(nullptr, platform()->peekGmmClientContext()); PublicGmmMemory gmmMemory; - EXPECT_EQ(gmmMemory.clientContext, GmmHelper::getClientContext()->getHandle()); + EXPECT_EQ(gmmMemory.clientContext, platform()->peekGmmClientContext()->getHandle()); } diff --git a/unit_tests/os_interface/windows/wddm20_tests.cpp b/unit_tests/os_interface/windows/wddm20_tests.cpp index d2f7cfdea5..6c07e234c3 100644 --- a/unit_tests/os_interface/windows/wddm20_tests.cpp +++ b/unit_tests/os_interface/windows/wddm20_tests.cpp @@ -5,12 +5,12 @@ * */ +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/hw_info.h" #include "core/os_interface/os_library.h" #include "core/unit_tests/helpers/debug_manager_state_restore.h" #include "runtime/execution_environment/execution_environment.h" #include "runtime/gmm_helper/gmm.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/helpers/options.h" #include "runtime/memory_manager/os_agnostic_memory_manager.h" #include "runtime/os_interface/os_time.h" diff --git a/unit_tests/os_interface/windows/wddm_kmdaf_listener_tests.cpp b/unit_tests/os_interface/windows/wddm_kmdaf_listener_tests.cpp index d3565b7c9c..6d7d77a4df 100644 --- a/unit_tests/os_interface/windows/wddm_kmdaf_listener_tests.cpp +++ b/unit_tests/os_interface/windows/wddm_kmdaf_listener_tests.cpp @@ -6,8 +6,8 @@ */ #include "core/command_stream/preemption.h" +#include "core/gmm_helper/gmm_helper.h" #include "runtime/gmm_helper/gmm.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/memory_manager/memory_manager.h" #include "runtime/os_interface/windows/wddm/wddm.h" #include "runtime/os_interface/windows/wddm_allocation.h" diff --git a/unit_tests/os_interface/windows/wddm_memory_manager_tests.cpp b/unit_tests/os_interface/windows/wddm_memory_manager_tests.cpp index 1e068103f7..a1e3f44af9 100644 --- a/unit_tests/os_interface/windows/wddm_memory_manager_tests.cpp +++ b/unit_tests/os_interface/windows/wddm_memory_manager_tests.cpp @@ -7,12 +7,12 @@ #include "unit_tests/os_interface/windows/wddm_memory_manager_tests.h" +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/aligned_memory.h" #include "core/os_interface/os_library.h" #include "core/unit_tests/helpers/debug_manager_state_restore.h" #include "core/unit_tests/utilities/base_object_utils.h" #include "runtime/gmm_helper/gmm.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/helpers/array_count.h" #include "runtime/helpers/memory_properties_flags_helpers.h" #include "runtime/mem_obj/buffer.h" diff --git a/unit_tests/program/program_tests.cpp b/unit_tests/program/program_tests.cpp index b28aeaae50..d13a068120 100644 --- a/unit_tests/program/program_tests.cpp +++ b/unit_tests/program/program_tests.cpp @@ -8,6 +8,7 @@ #include "unit_tests/program/program_tests.h" #include "core/elf/reader.h" +#include "core/gmm_helper/gmm_helper.h" #include "core/helpers/aligned_memory.h" #include "core/helpers/hash.h" #include "core/helpers/hw_helper.h" @@ -19,7 +20,6 @@ #include "runtime/command_stream/command_stream_receiver_hw.h" #include "runtime/compiler_interface/compiler_options.h" #include "runtime/compiler_interface/patchtokens_decoder.h" -#include "runtime/gmm_helper/gmm_helper.h" #include "runtime/helpers/hardware_commands_helper.h" #include "runtime/kernel/kernel.h" #include "runtime/memory_manager/allocations_list.h"