From 58ebebeec60f00a311bb938ecf80e90c2a69a86a Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Thu, 21 Oct 2021 14:50:10 +0000 Subject: [PATCH] Move drm_memory_manager_tests.h and related fixtures to shared Signed-off-by: Mateusz Jablonski --- ...te_command_queue_with_properties_tests.cpp | 2 +- .../api/cl_get_device_and_host_timer.inl | 2 +- .../command_queue/command_queue_tests.cpp | 2 +- .../enqueue_kernel_gl_tests_windows.cpp | 2 +- .../command_queue/oom_buffer_tests.cpp | 2 +- .../context/context_negative_tests.cpp | 3 ++- .../unit_test/device/device_timers_tests.cpp | 2 +- .../device/device_win_timers_tests.cpp | 2 +- opencl/test/unit_test/event/event_tests.cpp | 2 +- .../fixtures/memory_allocator_fixture.h | 2 +- .../memory_allocator_multi_device_fixture.h | 2 +- .../unit_test/fixtures/simple_arg_fixture.h | 2 +- .../unit_test/gen9/enqueue_kernel_gen9.cpp | 2 +- opencl/test/unit_test/gtpin/gtpin_tests.cpp | 2 +- .../helpers/memory_management_tests.cpp | 3 +-- .../kernel/gl/kernel_arg_buffer_tests.cpp | 5 ++-- .../kernel/kernel_arg_buffer_tests.cpp | 2 +- .../kernel/kernel_arg_info_tests.cpp | 2 +- opencl/test/unit_test/kernel/kernel_tests.cpp | 2 +- opencl/test/unit_test/libult/CMakeLists.txt | 2 -- opencl/test/unit_test/linux/CMakeLists.txt | 1 - .../test/unit_test/linux/main_linux_dll.cpp | 2 +- .../unit_test/mem_obj/buffer_pin_tests.cpp | 2 +- .../test/unit_test/mem_obj/buffer_tests.cpp | 2 +- .../mem_obj/create_image_format_tests.cpp | 3 ++- .../mem_obj/destructor_callback_tests.cpp | 3 ++- opencl/test/unit_test/mem_obj/image_tests.cpp | 2 +- opencl/test/unit_test/mem_obj/pipe_tests.cpp | 3 ++- .../unit_test/mem_obj/zero_copy_tests.cpp | 2 +- opencl/test/unit_test/mocks/CMakeLists.txt | 1 - .../linux/drm_memory_manager_mt_tests.cpp | 3 +-- .../os_interface/linux/CMakeLists.txt | 3 --- .../linux/device_command_stream_fixture_exp.h | 2 +- .../linux/device_command_stream_tests.cpp | 2 +- .../linux/drm_buffer_object_tests.cpp | 25 ++++++++----------- .../linux/drm_command_stream_fixture.h | 4 +-- .../linux/drm_command_stream_mm_tests.cpp | 2 +- .../linux/drm_command_stream_tests_1.cpp | 2 +- .../linux/drm_command_stream_tests_2.cpp | 2 +- .../linux/drm_gem_close_worker_tests.cpp | 2 +- .../linux/drm_memory_manager_tests.cpp | 2 +- .../linux/drm_memory_manager_tests_exp.h | 2 +- .../os_interface/linux/drm_tests.cpp | 2 +- .../linux/drm_va_sharing_tests.cpp | 3 ++- ...te_command_queue_with_properties_tests.cpp | 2 +- .../os_interface/linux/os_time_test.cpp | 2 +- .../os_interface/os_library_tests.cpp | 2 +- .../windows/device_command_stream_tests.cpp | 2 +- .../unit_test/program/program_with_source.h | 2 +- .../scheduler/scheduler_kernel_tests.cpp | 2 +- .../gl/windows/gl_sharing_enable_tests.cpp | 5 ++-- .../sharings/sharing_factory_tests.cpp | 2 +- .../sharings/va/va_sharing_enable_tests.cpp | 2 +- .../fixtures/memory_management_fixture.cpp | 2 +- .../fixtures/memory_management_fixture.h | 0 shared/test/common/libult/CMakeLists.txt | 10 ++++++++ shared/test/common/mocks/CMakeLists.txt | 1 + .../linux/mock_drm_command_stream_receiver.h | 0 shared/test/common/mocks/mock_device.cpp | 2 +- .../common/os_interface/linux/CMakeLists.txt | 2 +- .../linux/device_command_stream_fixture.cpp | 2 +- .../linux/device_command_stream_fixture.h | 0 .../linux/drm_memory_manager_tests.h | 7 +++--- .../linux/drm_direct_submission_tests.cpp | 2 +- 64 files changed, 88 insertions(+), 83 deletions(-) rename {opencl/test/unit_test => shared/test/common}/fixtures/memory_management_fixture.cpp (99%) rename {opencl/test/unit_test => shared/test/common}/fixtures/memory_management_fixture.h (100%) rename {opencl/test/unit_test => shared/test/common}/mocks/linux/mock_drm_command_stream_receiver.h (100%) rename {opencl/test/unit_test => shared/test/common}/os_interface/linux/device_command_stream_fixture.cpp (98%) rename {opencl/test/unit_test => shared/test/common}/os_interface/linux/device_command_stream_fixture.h (100%) rename {opencl/test/unit_test => shared/test/common}/os_interface/linux/drm_memory_manager_tests.h (97%) diff --git a/opencl/test/unit_test/api/cl_create_command_queue_with_properties_tests.cpp b/opencl/test/unit_test/api/cl_create_command_queue_with_properties_tests.cpp index 66187d77c5..786ce6676e 100644 --- a/opencl/test/unit_test/api/cl_create_command_queue_with_properties_tests.cpp +++ b/opencl/test/unit_test/api/cl_create_command_queue_with_properties_tests.cpp @@ -8,13 +8,13 @@ #include "shared/source/command_stream/command_stream_receiver.h" #include "shared/source/helpers/hw_helper.h" #include "shared/source/os_interface/os_context.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/unit_test_helper.h" #include "shared/test/common/helpers/variable_backup.h" #include "opencl/source/command_queue/command_queue.h" #include "opencl/source/device_queue/device_queue.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/mocks/mock_cl_device.h" #include "opencl/test/unit_test/mocks/mock_context.h" #include "opencl/test/unit_test/test_macros/test_checks_ocl.h" diff --git a/opencl/test/unit_test/api/cl_get_device_and_host_timer.inl b/opencl/test/unit_test/api/cl_get_device_and_host_timer.inl index c12a534901..e539649171 100644 --- a/opencl/test/unit_test/api/cl_get_device_and_host_timer.inl +++ b/opencl/test/unit_test/api/cl_get_device_and_host_timer.inl @@ -5,7 +5,7 @@ * */ -#include "shared/test//common/mocks/mock_ostime.h" +#include "shared/test/common/mocks/mock_ostime.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" diff --git a/opencl/test/unit_test/command_queue/command_queue_tests.cpp b/opencl/test/unit_test/command_queue/command_queue_tests.cpp index c929d334a5..494f44531e 100644 --- a/opencl/test/unit_test/command_queue/command_queue_tests.cpp +++ b/opencl/test/unit_test/command_queue/command_queue_tests.cpp @@ -13,6 +13,7 @@ #include "shared/source/memory_manager/internal_allocation_storage.h" #include "shared/source/memory_manager/memory_manager.h" #include "shared/source/os_interface/hw_info_config.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/unit_test_helper.h" #include "shared/test/common/helpers/variable_backup.h" @@ -36,7 +37,6 @@ #include "opencl/test/unit_test/fixtures/context_fixture.h" #include "opencl/test/unit_test/fixtures/dispatch_flags_fixture.h" #include "opencl/test/unit_test/fixtures/image_fixture.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/fixtures/multi_tile_fixture.h" #include "opencl/test/unit_test/helpers/raii_hw_helper.h" #include "opencl/test/unit_test/mocks/mock_command_queue.h" diff --git a/opencl/test/unit_test/command_queue/gl/windows/enqueue_kernel_gl_tests_windows.cpp b/opencl/test/unit_test/command_queue/gl/windows/enqueue_kernel_gl_tests_windows.cpp index 7c01d79273..b0039ee455 100644 --- a/opencl/test/unit_test/command_queue/gl/windows/enqueue_kernel_gl_tests_windows.cpp +++ b/opencl/test/unit_test/command_queue/gl/windows/enqueue_kernel_gl_tests_windows.cpp @@ -10,13 +10,13 @@ #include "shared/source/helpers/preamble.h" #include "shared/source/memory_manager/graphics_allocation.h" #include "shared/test/common/cmd_parse/hw_parse.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "shared/test/common/mocks/mock_csr.h" #include "shared/test/common/mocks/mock_gmm.h" #include "opencl/source/sharings/gl/gl_buffer.h" #include "opencl/test/unit_test/command_queue/enqueue_fixture.h" #include "opencl/test/unit_test/fixtures/hello_world_fixture.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/mocks/gl/windows/mock_gl_sharing_windows.h" #include "opencl/test/unit_test/mocks/mock_buffer.h" #include "opencl/test/unit_test/mocks/mock_submissions_aggregator.h" diff --git a/opencl/test/unit_test/command_queue/oom_buffer_tests.cpp b/opencl/test/unit_test/command_queue/oom_buffer_tests.cpp index 403361b643..647488f128 100644 --- a/opencl/test/unit_test/command_queue/oom_buffer_tests.cpp +++ b/opencl/test/unit_test/command_queue/oom_buffer_tests.cpp @@ -6,6 +6,7 @@ */ #include "shared/source/memory_manager/memory_manager.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "opencl/source/command_queue/command_queue_hw.h" #include "opencl/source/event/event.h" @@ -14,7 +15,6 @@ #include "opencl/test/unit_test/fixtures/buffer_fixture.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" #include "opencl/test/unit_test/fixtures/hello_world_kernel_fixture.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/fixtures/simple_arg_kernel_fixture.h" #include "test.h" diff --git a/opencl/test/unit_test/context/context_negative_tests.cpp b/opencl/test/unit_test/context/context_negative_tests.cpp index ed767a3a92..ac4f7e442e 100644 --- a/opencl/test/unit_test/context/context_negative_tests.cpp +++ b/opencl/test/unit_test/context/context_negative_tests.cpp @@ -5,10 +5,11 @@ * */ +#include "shared/test/common/fixtures/memory_management_fixture.h" + #include "opencl/source/context/context.h" #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/mocks/mock_platform.h" #include "test.h" diff --git a/opencl/test/unit_test/device/device_timers_tests.cpp b/opencl/test/unit_test/device/device_timers_tests.cpp index 38be8d0e40..b6890ec5f3 100644 --- a/opencl/test/unit_test/device/device_timers_tests.cpp +++ b/opencl/test/unit_test/device/device_timers_tests.cpp @@ -5,8 +5,8 @@ * */ -#include "shared/test//common/mocks/mock_ostime.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/test/common/mocks/mock_ostime.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" diff --git a/opencl/test/unit_test/device/device_win_timers_tests.cpp b/opencl/test/unit_test/device/device_win_timers_tests.cpp index ecd0b5b8e2..1a74662ca4 100644 --- a/opencl/test/unit_test/device/device_win_timers_tests.cpp +++ b/opencl/test/unit_test/device/device_win_timers_tests.cpp @@ -6,8 +6,8 @@ */ #include "shared/source/execution_environment/root_device_environment.h" -#include "shared/test//common/mocks/mock_ostime.h" #include "shared/test/common/mocks/mock_execution_environment.h" +#include "shared/test/common/mocks/mock_ostime.h" #include "shared/test/common/mocks/mock_wddm.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" diff --git a/opencl/test/unit_test/event/event_tests.cpp b/opencl/test/unit_test/event/event_tests.cpp index 1d63c62f95..f5bda5fe7f 100644 --- a/opencl/test/unit_test/event/event_tests.cpp +++ b/opencl/test/unit_test/event/event_tests.cpp @@ -11,12 +11,12 @@ #include "shared/source/os_interface/os_interface.h" #include "shared/source/utilities/perf_counter.h" #include "shared/source/utilities/tag_allocator.h" -#include "shared/test//common/mocks/mock_ostime.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/mocks/mock_allocation_properties.h" #include "shared/test/common/mocks/mock_csr.h" #include "shared/test/common/mocks/mock_device.h" #include "shared/test/common/mocks/mock_memory_manager.h" +#include "shared/test/common/mocks/mock_ostime.h" #include "shared/test/common/test_macros/test_checks_shared.h" #include "opencl/source/command_queue/command_queue_hw.h" diff --git a/opencl/test/unit_test/fixtures/memory_allocator_fixture.h b/opencl/test/unit_test/fixtures/memory_allocator_fixture.h index 8d391ef391..8ea3b79327 100644 --- a/opencl/test/unit_test/fixtures/memory_allocator_fixture.h +++ b/opencl/test/unit_test/fixtures/memory_allocator_fixture.h @@ -11,11 +11,11 @@ #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/helpers/hw_helper.h" #include "shared/source/memory_manager/os_agnostic_memory_manager.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "shared/test/common/helpers/engine_descriptor_helper.h" #include "shared/test/common/mocks/mock_device.h" #include "shared/test/common/mocks/mock_memory_manager.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/mocks/mock_platform.h" using namespace NEO; diff --git a/opencl/test/unit_test/fixtures/memory_allocator_multi_device_fixture.h b/opencl/test/unit_test/fixtures/memory_allocator_multi_device_fixture.h index a04fcaf191..db44f9f3f4 100644 --- a/opencl/test/unit_test/fixtures/memory_allocator_multi_device_fixture.h +++ b/opencl/test/unit_test/fixtures/memory_allocator_multi_device_fixture.h @@ -8,11 +8,11 @@ #pragma once #include "shared/source/gmm_helper/gmm.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/ult_hw_config.h" #include "shared/test/common/helpers/variable_backup.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/mocks/mock_platform.h" using namespace NEO; diff --git a/opencl/test/unit_test/fixtures/simple_arg_fixture.h b/opencl/test/unit_test/fixtures/simple_arg_fixture.h index fc35ea263f..fae230c080 100644 --- a/opencl/test/unit_test/fixtures/simple_arg_fixture.h +++ b/opencl/test/unit_test/fixtures/simple_arg_fixture.h @@ -8,10 +8,10 @@ #pragma once #include "shared/source/command_stream/command_stream_receiver.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/command_queue/command_queue_fixture.h" #include "opencl/test/unit_test/command_stream/command_stream_fixture.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/fixtures/simple_arg_kernel_fixture.h" namespace NEO { diff --git a/opencl/test/unit_test/gen9/enqueue_kernel_gen9.cpp b/opencl/test/unit_test/gen9/enqueue_kernel_gen9.cpp index ffb46eaea9..e04e41f169 100644 --- a/opencl/test/unit_test/gen9/enqueue_kernel_gen9.cpp +++ b/opencl/test/unit_test/gen9/enqueue_kernel_gen9.cpp @@ -6,10 +6,10 @@ */ #include "shared/source/gen9/reg_configs.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "opencl/source/command_queue/command_queue_hw.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/helpers/cl_hw_parse.h" #include "opencl/test/unit_test/helpers/static_size3.h" #include "opencl/test/unit_test/mocks/mock_kernel.h" diff --git a/opencl/test/unit_test/gtpin/gtpin_tests.cpp b/opencl/test/unit_test/gtpin/gtpin_tests.cpp index 7c05f00b6a..9370e2a4e5 100644 --- a/opencl/test/unit_test/gtpin/gtpin_tests.cpp +++ b/opencl/test/unit_test/gtpin/gtpin_tests.cpp @@ -13,6 +13,7 @@ #include "shared/source/memory_manager/surface.h" #include "shared/source/memory_manager/unified_memory_manager.h" #include "shared/source/os_interface/os_context.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/kernel_binary_helper.h" #include "shared/test/common/helpers/test_files.h" @@ -34,7 +35,6 @@ #include "opencl/source/mem_obj/buffer.h" #include "opencl/source/program/create.inl" #include "opencl/test/unit_test/fixtures/context_fixture.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/fixtures/platform_fixture.h" #include "opencl/test/unit_test/mocks/mock_buffer.h" #include "opencl/test/unit_test/mocks/mock_command_queue.h" diff --git a/opencl/test/unit_test/helpers/memory_management_tests.cpp b/opencl/test/unit_test/helpers/memory_management_tests.cpp index e6faaf99e1..c19d31dea0 100644 --- a/opencl/test/unit_test/helpers/memory_management_tests.cpp +++ b/opencl/test/unit_test/helpers/memory_management_tests.cpp @@ -5,10 +5,9 @@ * */ +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "shared/test/common/helpers/memory_management.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" - #include "gtest/gtest.h" using MemoryManagement::AllocationEvent; diff --git a/opencl/test/unit_test/kernel/gl/kernel_arg_buffer_tests.cpp b/opencl/test/unit_test/kernel/gl/kernel_arg_buffer_tests.cpp index 21c93bd11d..7fa756c870 100644 --- a/opencl/test/unit_test/kernel/gl/kernel_arg_buffer_tests.cpp +++ b/opencl/test/unit_test/kernel/gl/kernel_arg_buffer_tests.cpp @@ -1,16 +1,17 @@ /* - * Copyright (C) 2018-2020 Intel Corporation + * Copyright (C) 2018-2021 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "shared/test/common/fixtures/memory_management_fixture.h" + #include "opencl/source/kernel/kernel.h" #include "opencl/source/mem_obj/buffer.h" #include "opencl/source/sharings/gl/gl_buffer.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" #include "opencl/test/unit_test/fixtures/context_fixture.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/kernel/kernel_arg_buffer_fixture.h" #include "opencl/test/unit_test/mocks/gl/mock_gl_sharing.h" #include "opencl/test/unit_test/mocks/mock_buffer.h" diff --git a/opencl/test/unit_test/kernel/kernel_arg_buffer_tests.cpp b/opencl/test/unit_test/kernel/kernel_arg_buffer_tests.cpp index add7b72885..48b6a2dd61 100644 --- a/opencl/test/unit_test/kernel/kernel_arg_buffer_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_arg_buffer_tests.cpp @@ -7,13 +7,13 @@ #include "shared/source/memory_manager/unified_memory_manager.h" #include "shared/source/unified_memory/unified_memory.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "opencl/source/kernel/kernel.h" #include "opencl/source/mem_obj/buffer.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" #include "opencl/test/unit_test/fixtures/context_fixture.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/kernel/kernel_arg_buffer_fixture.h" #include "opencl/test/unit_test/mocks/mock_buffer.h" #include "opencl/test/unit_test/mocks/mock_context.h" diff --git a/opencl/test/unit_test/kernel/kernel_arg_info_tests.cpp b/opencl/test/unit_test/kernel/kernel_arg_info_tests.cpp index 157a107de2..a36ff73700 100644 --- a/opencl/test/unit_test/kernel/kernel_arg_info_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_arg_info_tests.cpp @@ -5,11 +5,11 @@ * */ +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "shared/test/common/helpers/kernel_binary_helper.h" #include "opencl/source/kernel/kernel.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/mocks/mock_kernel.h" #include "opencl/test/unit_test/mocks/mock_program.h" #include "opencl/test/unit_test/program/program_tests.h" diff --git a/opencl/test/unit_test/kernel/kernel_tests.cpp b/opencl/test/unit_test/kernel/kernel_tests.cpp index 83afac1d86..816012b61f 100644 --- a/opencl/test/unit_test/kernel/kernel_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_tests.cpp @@ -16,6 +16,7 @@ #include "shared/source/memory_manager/unified_memory_manager.h" #include "shared/source/os_interface/hw_info_config.h" #include "shared/source/os_interface/os_context.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/libult/ult_command_stream_receiver.h" #include "shared/test/common/mocks/mock_allocation_properties.h" @@ -32,7 +33,6 @@ #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" #include "opencl/test/unit_test/fixtures/device_host_queue_fixture.h" #include "opencl/test/unit_test/fixtures/execution_model_fixture.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/fixtures/multi_root_device_fixture.h" #include "opencl/test/unit_test/helpers/gtest_helpers.h" #include "opencl/test/unit_test/mocks/mock_command_queue.h" diff --git a/opencl/test/unit_test/libult/CMakeLists.txt b/opencl/test/unit_test/libult/CMakeLists.txt index 0bac013093..7aa462ecca 100644 --- a/opencl/test/unit_test/libult/CMakeLists.txt +++ b/opencl/test/unit_test/libult/CMakeLists.txt @@ -38,8 +38,6 @@ set(IGDRCL_SRCS_LIB_ULT_ENV ${NEO_SOURCE_DIR}/opencl/test/unit_test/main.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/command_queue/command_queue_fixture.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/command_queue/command_queue_fixture.h - ${NEO_SOURCE_DIR}/opencl/test/unit_test/fixtures/memory_management_fixture.cpp - ${NEO_SOURCE_DIR}/opencl/test/unit_test/fixtures/memory_management_fixture.h ${NEO_SOURCE_DIR}/opencl/test/unit_test/fixtures/built_in_fixture.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/fixtures/built_in_fixture.h ${NEO_SOURCE_DIR}/opencl/test/unit_test/fixtures/buffer_fixture.cpp diff --git a/opencl/test/unit_test/linux/CMakeLists.txt b/opencl/test/unit_test/linux/CMakeLists.txt index 379c7f89db..2fe5c761ff 100644 --- a/opencl/test/unit_test/linux/CMakeLists.txt +++ b/opencl/test/unit_test/linux/CMakeLists.txt @@ -29,7 +29,6 @@ add_executable(igdrcl_${target_name} ${NEO_SOURCE_DIR}/opencl/source/helpers/api_specific_config_ocl.cpp ${NEO_SOURCE_DIR}/opencl/source/os_interface/linux/platform_teardown_linux.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/linux${BRANCH_DIR_SUFFIX}drm_other_requests.cpp - ${NEO_SOURCE_DIR}/opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/test_configuration/unit_tests/test_mode.h ) if(NEO__LIBVA_FOUND) diff --git a/opencl/test/unit_test/linux/main_linux_dll.cpp b/opencl/test/unit_test/linux/main_linux_dll.cpp index 98ccef95ea..39dd64793c 100644 --- a/opencl/test/unit_test/linux/main_linux_dll.cpp +++ b/opencl/test/unit_test/linux/main_linux_dll.cpp @@ -19,11 +19,11 @@ #include "shared/test/common/helpers/ult_hw_config.inl" #include "shared/test/common/helpers/variable_backup.h" #include "shared/test/common/mocks/mock_execution_environment.h" +#include "shared/test/common/os_interface/linux/device_command_stream_fixture.h" #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/linux/drm_wrap.h" #include "opencl/test/unit_test/linux/mock_os_layer.h" -#include "opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h" #include "test.h" #include "gmock/gmock.h" diff --git a/opencl/test/unit_test/mem_obj/buffer_pin_tests.cpp b/opencl/test/unit_test/mem_obj/buffer_pin_tests.cpp index 77ec726781..2c3ca28bd1 100644 --- a/opencl/test/unit_test/mem_obj/buffer_pin_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_pin_tests.cpp @@ -6,12 +6,12 @@ */ #include "shared/source/memory_manager/os_agnostic_memory_manager.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/mock_memory_manager.h" #include "opencl/source/mem_obj/buffer.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/fixtures/platform_fixture.h" #include "opencl/test/unit_test/mocks/mock_context.h" #include "test.h" diff --git a/opencl/test/unit_test/mem_obj/buffer_tests.cpp b/opencl/test/unit_test/mem_obj/buffer_tests.cpp index ee48430169..269728b464 100644 --- a/opencl/test/unit_test/mem_obj/buffer_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_tests.cpp @@ -10,6 +10,7 @@ #include "shared/source/helpers/hw_helper.h" #include "shared/source/memory_manager/memory_operations_handler.h" #include "shared/source/memory_manager/unified_memory_manager.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "shared/test/common/helpers/ult_hw_config.h" #include "shared/test/common/helpers/unit_test_helper.h" #include "shared/test/common/mocks/mock_allocation_properties.h" @@ -22,7 +23,6 @@ #include "opencl/extensions/public/cl_ext_private.h" #include "opencl/source/command_queue/command_queue_hw.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/fixtures/multi_root_device_fixture.h" #include "opencl/test/unit_test/mocks/mock_buffer.h" #include "opencl/test/unit_test/mocks/mock_command_queue.h" diff --git a/opencl/test/unit_test/mem_obj/create_image_format_tests.cpp b/opencl/test/unit_test/mem_obj/create_image_format_tests.cpp index 22b0b527e1..76695db92d 100644 --- a/opencl/test/unit_test/mem_obj/create_image_format_tests.cpp +++ b/opencl/test/unit_test/mem_obj/create_image_format_tests.cpp @@ -5,11 +5,12 @@ * */ +#include "shared/test/common/fixtures/memory_management_fixture.h" + #include "opencl/source/helpers/cl_memory_properties_helpers.h" #include "opencl/source/helpers/surface_formats.h" #include "opencl/source/mem_obj/image.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/mocks/mock_context.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/mem_obj/destructor_callback_tests.cpp b/opencl/test/unit_test/mem_obj/destructor_callback_tests.cpp index cb0bc35172..f5da1ce14f 100644 --- a/opencl/test/unit_test/mem_obj/destructor_callback_tests.cpp +++ b/opencl/test/unit_test/mem_obj/destructor_callback_tests.cpp @@ -5,9 +5,10 @@ * */ +#include "shared/test/common/fixtures/memory_management_fixture.h" + #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/fixtures/buffer_fixture.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "test.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/mem_obj/image_tests.cpp b/opencl/test/unit_test/mem_obj/image_tests.cpp index 6a576c0e3d..90b035e6d5 100644 --- a/opencl/test/unit_test/mem_obj/image_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image_tests.cpp @@ -10,6 +10,7 @@ #include "shared/source/helpers/aligned_memory.h" #include "shared/source/image/image_surface_state.h" #include "shared/source/os_interface/os_context.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/kernel_binary_helper.h" #include "shared/test/common/helpers/unit_test_helper.h" @@ -24,7 +25,6 @@ #include "opencl/test/unit_test/command_queue/command_queue_fixture.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" #include "opencl/test/unit_test/fixtures/image_fixture.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/fixtures/multi_root_device_fixture.h" #include "opencl/test/unit_test/mem_obj/image_compression_fixture.h" #include "opencl/test/unit_test/mocks/mock_context.h" diff --git a/opencl/test/unit_test/mem_obj/pipe_tests.cpp b/opencl/test/unit_test/mem_obj/pipe_tests.cpp index 2d9eadefa8..8a2879d4e2 100644 --- a/opencl/test/unit_test/mem_obj/pipe_tests.cpp +++ b/opencl/test/unit_test/mem_obj/pipe_tests.cpp @@ -5,10 +5,11 @@ * */ +#include "shared/test/common/fixtures/memory_management_fixture.h" + #include "opencl/source/command_queue/command_queue.h" #include "opencl/source/mem_obj/pipe.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/fixtures/multi_root_device_fixture.h" #include "opencl/test/unit_test/mocks/mock_command_queue.h" #include "opencl/test/unit_test/mocks/mock_context.h" diff --git a/opencl/test/unit_test/mem_obj/zero_copy_tests.cpp b/opencl/test/unit_test/mem_obj/zero_copy_tests.cpp index 3457dd3678..8f88c82b0b 100644 --- a/opencl/test/unit_test/mem_obj/zero_copy_tests.cpp +++ b/opencl/test/unit_test/mem_obj/zero_copy_tests.cpp @@ -6,11 +6,11 @@ */ #include "shared/source/helpers/aligned_memory.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "opencl/source/mem_obj/buffer.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/mocks/mock_context.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/mocks/CMakeLists.txt b/opencl/test/unit_test/mocks/CMakeLists.txt index 75aa9a68c8..8ff526e7eb 100644 --- a/opencl/test/unit_test/mocks/CMakeLists.txt +++ b/opencl/test/unit_test/mocks/CMakeLists.txt @@ -67,7 +67,6 @@ if(WIN32) ) else() list(APPEND IGDRCL_SRCS_tests_mocks - ${CMAKE_CURRENT_SOURCE_DIR}/linux/mock_drm_command_stream_receiver.h ${NEO_SHARED_DIRECTORY}/os_interface/linux/page_table_manager_functions.cpp ) endif() diff --git a/opencl/test/unit_test/mt_tests/os_interface/linux/drm_memory_manager_mt_tests.cpp b/opencl/test/unit_test/mt_tests/os_interface/linux/drm_memory_manager_mt_tests.cpp index 9bb9d1d90b..ada724d855 100644 --- a/opencl/test/unit_test/mt_tests/os_interface/linux/drm_memory_manager_mt_tests.cpp +++ b/opencl/test/unit_test/mt_tests/os_interface/linux/drm_memory_manager_mt_tests.cpp @@ -11,8 +11,7 @@ #include "shared/source/os_interface/os_interface.h" #include "shared/test/common/mocks/linux/mock_drm_memory_manager.h" #include "shared/test/common/mocks/mock_execution_environment.h" - -#include "opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h" +#include "shared/test/common/os_interface/linux/device_command_stream_fixture.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/os_interface/linux/CMakeLists.txt b/opencl/test/unit_test/os_interface/linux/CMakeLists.txt index 30b819f6b1..49e8692dbc 100644 --- a/opencl/test/unit_test/os_interface/linux/CMakeLists.txt +++ b/opencl/test/unit_test/os_interface/linux/CMakeLists.txt @@ -8,8 +8,6 @@ set(IGDRCL_SRCS_tests_os_interface_linux ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/allocator_helper_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/debug_env_reader.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/device_command_stream_fixture.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/device_command_stream_fixture.h ${CMAKE_CURRENT_SOURCE_DIR}/device_command_stream_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/device_factory_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/device_factory_tests.h @@ -25,7 +23,6 @@ set(IGDRCL_SRCS_tests_os_interface_linux ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}drm_mapper_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}drm_engine_info_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/drm_memory_manager_tests.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/drm_memory_manager_tests.h ${CMAKE_CURRENT_SOURCE_DIR}/drm_neo_create.cpp ${CMAKE_CURRENT_SOURCE_DIR}/drm_os_memory_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/drm_residency_handler_tests.cpp diff --git a/opencl/test/unit_test/os_interface/linux/device_command_stream_fixture_exp.h b/opencl/test/unit_test/os_interface/linux/device_command_stream_fixture_exp.h index 737ffbfcbc..ad35ec4fe3 100644 --- a/opencl/test/unit_test/os_interface/linux/device_command_stream_fixture_exp.h +++ b/opencl/test/unit_test/os_interface/linux/device_command_stream_fixture_exp.h @@ -6,7 +6,7 @@ */ #pragma once -#include "opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h" +#include "shared/test/common/os_interface/linux/device_command_stream_fixture.h" class DrmMockCustomExp : public DrmMockCustom { public: diff --git a/opencl/test/unit_test/os_interface/linux/device_command_stream_tests.cpp b/opencl/test/unit_test/os_interface/linux/device_command_stream_tests.cpp index 9fbd73e2fc..22e988cc6a 100644 --- a/opencl/test/unit_test/os_interface/linux/device_command_stream_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/device_command_stream_tests.cpp @@ -14,11 +14,11 @@ #include "shared/source/os_interface/linux/drm_neo.h" #include "shared/source/os_interface/os_interface.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/test/common/os_interface/linux/device_command_stream_fixture.h" #include "shared/test/unit_test/fixtures/mock_aub_center_fixture.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" #include "opencl/test/unit_test/helpers/execution_environment_helper.h" -#include "opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h" #include "test.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/os_interface/linux/drm_buffer_object_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_buffer_object_tests.cpp index 784f564c28..531c2627a3 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_buffer_object_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_buffer_object_tests.cpp @@ -15,8 +15,8 @@ #include "shared/test/common/mocks/linux/mock_drm_allocation.h" #include "shared/test/common/mocks/mock_device.h" #include "shared/test/common/mocks/mock_execution_environment.h" +#include "shared/test/common/os_interface/linux/device_command_stream_fixture.h" -#include "opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h" #include "test.h" #include "drm/i915_drm.h" @@ -500,14 +500,18 @@ TEST_F(DrmBufferObjectTest, givenAsyncDebugFlagWhenFillingExecObjectThenFlagIsSe EXPECT_TRUE(execObject.flags & EXEC_OBJECT_ASYNC); } + +struct MockGmmHelper : GmmHelper { + using GmmHelper::addressWidth; +}; + TEST_F(DrmBufferObjectTest, given47bitAddressWhenSetThenIsAddressNotCanonized) { - auto hwInfoAddressWidth = Math::log2(defaultHwInfo.get()->capabilityTable.gpuAddressSpace + 1); + VariableBackup backup(&MockGmmHelper::addressWidth, 48); MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); DrmMock drm(*(executionEnvironment.rootDeviceEnvironments[0].get())); - auto toShift = hwInfoAddressWidth - 36; - uint64_t address = 0x7fff00000 << toShift; + uint64_t address = maxNBitValue(47) - maxNBitValue(5); MockBufferObject bo(&drm, 0, 0, 1); bo.setAddress(address); @@ -515,20 +519,13 @@ TEST_F(DrmBufferObjectTest, given47bitAddressWhenSetThenIsAddressNotCanonized) { EXPECT_EQ(boAddress, address); } TEST_F(DrmBufferObjectTest, given48bitAddressWhenSetThenAddressIsCanonized) { - auto hwInfoAddressWidth = Math::log2(defaultHwInfo.get()->capabilityTable.gpuAddressSpace + 1); + VariableBackup backup(&MockGmmHelper::addressWidth, 48); MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); DrmMock drm(*(executionEnvironment.rootDeviceEnvironments[0].get())); - auto toShift = hwInfoAddressWidth - 36; - uint64_t address = 0x8fff00000 << toShift; - uint64_t expectedAddress = 0; - - if (hwInfoAddressWidth < 48) { - expectedAddress = 0x8fff00000 << toShift; - } else { - expectedAddress = 0xfffffff8fff00000 << toShift; - } + uint64_t address = maxNBitValue(48) - maxNBitValue(5); + uint64_t expectedAddress = std::numeric_limits::max() - maxNBitValue(5); MockBufferObject bo(&drm, 0, 0, 1); bo.setAddress(address); diff --git a/opencl/test/unit_test/os_interface/linux/drm_command_stream_fixture.h b/opencl/test/unit_test/os_interface/linux/drm_command_stream_fixture.h index abac310d5a..96f2cd0fad 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_command_stream_fixture.h +++ b/opencl/test/unit_test/os_interface/linux/drm_command_stream_fixture.h @@ -13,11 +13,11 @@ #include "shared/source/os_interface/os_interface.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/engine_descriptor_helper.h" +#include "shared/test/common/mocks/linux/mock_drm_command_stream_receiver.h" #include "shared/test/common/mocks/mock_execution_environment.h" +#include "shared/test/common/os_interface/linux/device_command_stream_fixture.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" -#include "opencl/test/unit_test/mocks/linux/mock_drm_command_stream_receiver.h" -#include "opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h" #include "test.h" #include "gmock/gmock.h" diff --git a/opencl/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp index 6108a32f73..9629f3f894 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp @@ -13,9 +13,9 @@ #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/mocks/linux/mock_drm_memory_manager.h" #include "shared/test/common/mocks/mock_execution_environment.h" +#include "shared/test/common/os_interface/linux/device_command_stream_fixture.h" #include "opencl/source/platform/platform.h" -#include "opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h" #include "test.h" using namespace NEO; diff --git a/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp b/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp index c4a047748b..2ac6401f2f 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp @@ -24,6 +24,7 @@ #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/dispatch_flags_helper.h" #include "shared/test/common/helpers/engine_descriptor_helper.h" +#include "shared/test/common/mocks/linux/mock_drm_command_stream_receiver.h" #include "shared/test/common/mocks/mock_allocation_properties.h" #include "shared/test/common/mocks/mock_gmm.h" #include "shared/test/common/mocks/mock_gmm_page_table_mngr.h" @@ -32,7 +33,6 @@ #include "opencl/source/mem_obj/buffer.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" #include "opencl/test/unit_test/helpers/execution_environment_helper.h" -#include "opencl/test/unit_test/mocks/linux/mock_drm_command_stream_receiver.h" #include "opencl/test/unit_test/mocks/mock_buffer.h" #include "opencl/test/unit_test/mocks/mock_program.h" #include "opencl/test/unit_test/mocks/mock_submissions_aggregator.h" diff --git a/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_2.cpp b/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_2.cpp index 66b28662ca..2c739dc10b 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_2.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests_2.cpp @@ -22,6 +22,7 @@ #include "shared/test/common/cmd_parse/hw_parse.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/dispatch_flags_helper.h" +#include "shared/test/common/mocks/linux/mock_drm_command_stream_receiver.h" #include "shared/test/common/mocks/mock_allocation_properties.h" #include "shared/test/common/mocks/mock_gmm.h" #include "shared/test/common/mocks/mock_gmm_page_table_mngr.h" @@ -31,7 +32,6 @@ #include "opencl/source/mem_obj/buffer.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" #include "opencl/test/unit_test/helpers/execution_environment_helper.h" -#include "opencl/test/unit_test/mocks/linux/mock_drm_command_stream_receiver.h" #include "opencl/test/unit_test/mocks/mock_buffer.h" #include "opencl/test/unit_test/mocks/mock_program.h" #include "opencl/test/unit_test/mocks/mock_submissions_aggregator.h" diff --git a/opencl/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp index e028c859db..d6e8710ec7 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp @@ -15,9 +15,9 @@ #include "shared/source/os_interface/linux/drm_memory_operations_handler.h" #include "shared/source/os_interface/os_interface.h" #include "shared/test/common/mocks/mock_execution_environment.h" +#include "shared/test/common/os_interface/linux/device_command_stream_fixture.h" #include "opencl/source/mem_obj/buffer.h" -#include "opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h" #include "test.h" #include "drm/i915_drm.h" diff --git a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp index d2f8d63b42..d02b8179ae 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp @@ -5,7 +5,7 @@ * */ -#include "drm_memory_manager_tests.h" +#include "shared/test/common/os_interface/linux/drm_memory_manager_tests.h" #include "shared/source/built_ins/sip.h" #include "shared/source/command_stream/device_command_stream.h" diff --git a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests_exp.h b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests_exp.h index e38bcad5be..6fe9642171 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests_exp.h +++ b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests_exp.h @@ -8,9 +8,9 @@ #pragma once #include "shared/test/common/helpers/ult_hw_config.h" #include "shared/test/common/helpers/variable_backup.h" +#include "shared/test/common/os_interface/linux/drm_memory_manager_tests.h" #include "opencl/test/unit_test/os_interface/linux/device_command_stream_fixture_exp.h" -#include "opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.h" namespace NEO { diff --git a/opencl/test/unit_test/os_interface/linux/drm_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_tests.cpp index 201d4662d5..70e4bc2c95 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_tests.cpp @@ -10,12 +10,12 @@ #include "shared/source/os_interface/device_factory.h" #include "shared/source/os_interface/linux/os_context_linux.h" #include "shared/source/os_interface/os_interface.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/helpers/engine_descriptor_helper.h" #include "shared/test/common/libult/linux/drm_mock.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/mocks/mock_platform.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/os_interface/linux/drm_va_sharing_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_va_sharing_tests.cpp index 6839d54e93..7b12a4ad98 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_va_sharing_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_va_sharing_tests.cpp @@ -5,11 +5,12 @@ * */ +#include "shared/test/common/os_interface/linux/drm_memory_manager_tests.h" + #include "opencl/source/mem_obj/image.h" #include "opencl/source/sharings/va/va_surface.h" #include "opencl/test/unit_test/mocks/mock_cl_device.h" #include "opencl/test/unit_test/mocks/mock_context.h" -#include "opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.h" #include "opencl/test/unit_test/sharings/va/mock_va_sharing.h" #include "test.h" diff --git a/opencl/test/unit_test/os_interface/linux/linux_create_command_queue_with_properties_tests.cpp b/opencl/test/unit_test/os_interface/linux/linux_create_command_queue_with_properties_tests.cpp index 4e2a7b40e9..82ec37a64b 100644 --- a/opencl/test/unit_test/os_interface/linux/linux_create_command_queue_with_properties_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/linux_create_command_queue_with_properties_tests.cpp @@ -8,11 +8,11 @@ #include "shared/source/os_interface/linux/drm_memory_operations_handler.h" #include "shared/source/os_interface/os_interface.h" #include "shared/test/common/libult/linux/drm_mock.h" +#include "shared/test/common/mocks/linux/mock_drm_command_stream_receiver.h" #include "shared/test/common/mocks/linux/mock_drm_memory_manager.h" #include "opencl/source/command_queue/command_queue_hw.h" #include "opencl/test/unit_test/fixtures/ult_command_stream_receiver_fixture.h" -#include "opencl/test/unit_test/mocks/linux/mock_drm_command_stream_receiver.h" #include "opencl/test/unit_test/mocks/mock_context.h" #include "test.h" diff --git a/opencl/test/unit_test/os_interface/linux/os_time_test.cpp b/opencl/test/unit_test/os_interface/linux/os_time_test.cpp index 8d1f345caf..19b276563c 100644 --- a/opencl/test/unit_test/os_interface/linux/os_time_test.cpp +++ b/opencl/test/unit_test/os_interface/linux/os_time_test.cpp @@ -9,8 +9,8 @@ #include "shared/source/os_interface/linux/os_time_linux.h" #include "shared/source/os_interface/os_interface.h" #include "shared/test/common/mocks/mock_execution_environment.h" +#include "shared/test/common/os_interface/linux/device_command_stream_fixture.h" -#include "opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h" #include "opencl/test/unit_test/os_interface/linux/mock_os_time_linux.h" #include "test.h" diff --git a/opencl/test/unit_test/os_interface/os_library_tests.cpp b/opencl/test/unit_test/os_interface/os_library_tests.cpp index bc19822c9f..249a6d572e 100644 --- a/opencl/test/unit_test/os_interface/os_library_tests.cpp +++ b/opencl/test/unit_test/os_interface/os_library_tests.cpp @@ -11,8 +11,8 @@ #include "shared/source/os_interface/linux/os_library_linux.h" #endif #include "shared/source/os_interface/os_library.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "test.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp b/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp index 301a4cd2b2..2bcf63d531 100644 --- a/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/device_command_stream_tests.cpp @@ -24,6 +24,7 @@ #include "shared/source/os_interface/windows/wddm_memory_operations_handler.h" #include "shared/source/os_interface/windows/wddm_residency_controller.h" #include "shared/test/common/fixtures/device_fixture.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/dispatch_flags_helper.h" #include "shared/test/common/helpers/engine_descriptor_helper.h" @@ -41,7 +42,6 @@ #include "opencl/source/mem_obj/buffer.h" #include "opencl/source/platform/platform.h" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/helpers/execution_environment_helper.h" #include "opencl/test/unit_test/mocks/mock_buffer.h" #include "opencl/test/unit_test/mocks/mock_platform.h" diff --git a/opencl/test/unit_test/program/program_with_source.h b/opencl/test/unit_test/program/program_with_source.h index 3f47f56d63..b6b3bb4c54 100644 --- a/opencl/test/unit_test/program/program_with_source.h +++ b/opencl/test/unit_test/program/program_with_source.h @@ -8,10 +8,10 @@ #pragma once #include "shared/source/compiler_interface/compiler_interface.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "shared/test/common/helpers/kernel_binary_helper.h" #include "opencl/test/unit_test/fixtures/context_fixture.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/fixtures/platform_fixture.h" #include "opencl/test/unit_test/fixtures/program_fixture.h" #include "opencl/test/unit_test/mocks/mock_context.h" diff --git a/opencl/test/unit_test/scheduler/scheduler_kernel_tests.cpp b/opencl/test/unit_test/scheduler/scheduler_kernel_tests.cpp index 9c2e42b44d..1ba97bf077 100644 --- a/opencl/test/unit_test/scheduler/scheduler_kernel_tests.cpp +++ b/opencl/test/unit_test/scheduler/scheduler_kernel_tests.cpp @@ -5,10 +5,10 @@ * */ -#include "shared/test//common/mocks/mock_ostime.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/mocks/mock_device.h" #include "shared/test/common/mocks/mock_graphics_allocation.h" +#include "shared/test/common/mocks/mock_ostime.h" #include "shared/test/unit_test/utilities/base_object_utils.h" #include "opencl/source/scheduler/scheduler_kernel.h" diff --git a/opencl/test/unit_test/sharings/gl/windows/gl_sharing_enable_tests.cpp b/opencl/test/unit_test/sharings/gl/windows/gl_sharing_enable_tests.cpp index a14db3c928..1c1d461afa 100644 --- a/opencl/test/unit_test/sharings/gl/windows/gl_sharing_enable_tests.cpp +++ b/opencl/test/unit_test/sharings/gl/windows/gl_sharing_enable_tests.cpp @@ -1,12 +1,13 @@ /* - * Copyright (C) 2018-2020 Intel Corporation + * Copyright (C) 2018-2021 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "shared/test/common/fixtures/memory_management_fixture.h" + #include "opencl/source/sharings/gl/windows/win_enable_gl.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/mocks/mock_context.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/sharings/sharing_factory_tests.cpp b/opencl/test/unit_test/sharings/sharing_factory_tests.cpp index 940bcf01c4..ebb34d4152 100644 --- a/opencl/test/unit_test/sharings/sharing_factory_tests.cpp +++ b/opencl/test/unit_test/sharings/sharing_factory_tests.cpp @@ -8,6 +8,7 @@ #include "shared/source/command_stream/command_stream_receiver.h" #include "shared/source/device/device.h" #include "shared/source/helpers/string.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/mocks/mock_device.h" @@ -16,7 +17,6 @@ #include "opencl/source/platform/platform.h" #include "opencl/source/sharings/sharing.h" #include "opencl/source/sharings/sharing_factory.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/mocks/mock_cl_device.h" #include "opencl/test/unit_test/mocks/mock_context.h" #include "opencl/test/unit_test/mocks/mock_platform.h" diff --git a/opencl/test/unit_test/sharings/va/va_sharing_enable_tests.cpp b/opencl/test/unit_test/sharings/va/va_sharing_enable_tests.cpp index c7f18e5959..bf22900968 100644 --- a/opencl/test/unit_test/sharings/va/va_sharing_enable_tests.cpp +++ b/opencl/test/unit_test/sharings/va/va_sharing_enable_tests.cpp @@ -7,11 +7,11 @@ #include "shared/source/helpers/string.h" #include "shared/source/os_interface/driver_info.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "shared/test/common/helpers/variable_backup.h" #include "opencl/source/sharings/va/enable_va.h" #include "opencl/source/sharings/va/va_sharing_functions.h" -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" #include "opencl/test/unit_test/mocks/mock_context.h" #include "gtest/gtest.h" diff --git a/opencl/test/unit_test/fixtures/memory_management_fixture.cpp b/shared/test/common/fixtures/memory_management_fixture.cpp similarity index 99% rename from opencl/test/unit_test/fixtures/memory_management_fixture.cpp rename to shared/test/common/fixtures/memory_management_fixture.cpp index 3bbda1f5e4..484f8f4a37 100644 --- a/opencl/test/unit_test/fixtures/memory_management_fixture.cpp +++ b/shared/test/common/fixtures/memory_management_fixture.cpp @@ -5,7 +5,7 @@ * */ -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "shared/test/common/helpers/memory_leak_listener.h" #include "shared/test/common/helpers/memory_management.h" diff --git a/opencl/test/unit_test/fixtures/memory_management_fixture.h b/shared/test/common/fixtures/memory_management_fixture.h similarity index 100% rename from opencl/test/unit_test/fixtures/memory_management_fixture.h rename to shared/test/common/fixtures/memory_management_fixture.h diff --git a/shared/test/common/libult/CMakeLists.txt b/shared/test/common/libult/CMakeLists.txt index 736ccc24a8..22a9e1afff 100644 --- a/shared/test/common/libult/CMakeLists.txt +++ b/shared/test/common/libult/CMakeLists.txt @@ -67,6 +67,8 @@ set(igdrcl_libult_common_SRCS_LIB_ULT ${NEO_SHARED_TEST_DIRECTORY}/common/helpers/memory_leak_listener.h ${NEO_SHARED_TEST_DIRECTORY}/common/helpers/memory_management.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/helpers/memory_management.h + ${NEO_SHARED_TEST_DIRECTORY}/common/fixtures/memory_management_fixture.cpp + ${NEO_SHARED_TEST_DIRECTORY}/common/fixtures/memory_management_fixture.h ${NEO_SHARED_TEST_DIRECTORY}/common/helpers/sip_init.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/helpers/test_files.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/helpers/test_files.h @@ -114,8 +116,16 @@ set(igdrcl_libult_common_SRCS_LIB_ULT_WIN ${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/windows/ult_dxgi_factory.h ) +set(igdrcl_libult_common_SRCS_LIB_ULT_LINUX + ${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/linux/device_command_stream_fixture.cpp + ${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/linux/device_command_stream_fixture.h +) +set_property(GLOBAL PROPERTY igdrcl_libult_common_SRCS_LIB_ULT_LINUX ${igdrcl_libult_common_SRCS_LIB_ULT_LINUX}) + if(WIN32) target_sources(igdrcl_libult_common PRIVATE ${igdrcl_libult_common_SRCS_LIB_ULT_WIN}) +elseif(UNIX) + target_sources(igdrcl_libult_common PRIVATE ${igdrcl_libult_common_SRCS_LIB_ULT_LINUX}) endif() target_include_directories(igdrcl_libult_common PRIVATE diff --git a/shared/test/common/mocks/CMakeLists.txt b/shared/test/common/mocks/CMakeLists.txt index f61883687a..5a41641532 100644 --- a/shared/test/common/mocks/CMakeLists.txt +++ b/shared/test/common/mocks/CMakeLists.txt @@ -90,6 +90,7 @@ if(WIN32) else() list(APPEND NEO_CORE_tests_mocks ${CMAKE_CURRENT_SOURCE_DIR}/linux/mock_drm_allocation.h + ${CMAKE_CURRENT_SOURCE_DIR}/linux/mock_drm_command_stream_receiver.h ${CMAKE_CURRENT_SOURCE_DIR}/linux/mock_drm_memory_manager.cpp ${CMAKE_CURRENT_SOURCE_DIR}/linux/mock_drm_memory_manager.h ) diff --git a/opencl/test/unit_test/mocks/linux/mock_drm_command_stream_receiver.h b/shared/test/common/mocks/linux/mock_drm_command_stream_receiver.h similarity index 100% rename from opencl/test/unit_test/mocks/linux/mock_drm_command_stream_receiver.h rename to shared/test/common/mocks/linux/mock_drm_command_stream_receiver.h diff --git a/shared/test/common/mocks/mock_device.cpp b/shared/test/common/mocks/mock_device.cpp index 75bd6acea3..2ca66ae645 100644 --- a/shared/test/common/mocks/mock_device.cpp +++ b/shared/test/common/mocks/mock_device.cpp @@ -10,9 +10,9 @@ #include "shared/source/command_stream/command_stream_receiver.h" #include "shared/source/command_stream/preemption.h" #include "shared/source/os_interface/os_context.h" -#include "shared/test//common/mocks/mock_ostime.h" #include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/mock_memory_manager.h" +#include "shared/test/common/mocks/mock_ostime.h" #include "shared/test/common/mocks/ult_device_factory.h" #include "shared/test/unit_test/tests_configuration.h" diff --git a/shared/test/common/os_interface/linux/CMakeLists.txt b/shared/test/common/os_interface/linux/CMakeLists.txt index ef25ec5ae8..081a1801f0 100644 --- a/shared/test/common/os_interface/linux/CMakeLists.txt +++ b/shared/test/common/os_interface/linux/CMakeLists.txt @@ -7,7 +7,7 @@ if(UNIX) target_sources(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/drm_memory_manager_tests.h ) - add_subdirectories() endif() diff --git a/opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.cpp b/shared/test/common/os_interface/linux/device_command_stream_fixture.cpp similarity index 98% rename from opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.cpp rename to shared/test/common/os_interface/linux/device_command_stream_fixture.cpp index 0d45c65f25..e26f4cd03a 100644 --- a/opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.cpp +++ b/shared/test/common/os_interface/linux/device_command_stream_fixture.cpp @@ -5,7 +5,7 @@ * */ -#include "opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h" +#include "shared/test/common/os_interface/linux/device_command_stream_fixture.h" const int mockFd = 33; const char *mockPciPath = ""; diff --git a/opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h b/shared/test/common/os_interface/linux/device_command_stream_fixture.h similarity index 100% rename from opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h rename to shared/test/common/os_interface/linux/device_command_stream_fixture.h diff --git a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.h b/shared/test/common/os_interface/linux/drm_memory_manager_tests.h similarity index 97% rename from opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.h rename to shared/test/common/os_interface/linux/drm_memory_manager_tests.h index 372b6eda25..2d31d96f8c 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.h +++ b/shared/test/common/os_interface/linux/drm_memory_manager_tests.h @@ -9,17 +9,16 @@ #include "shared/source/os_interface/linux/drm_memory_operations_handler.h" #include "shared/source/os_interface/linux/memory_info.h" #include "shared/source/os_interface/os_interface.h" +#include "shared/test/common/fixtures/memory_management_fixture.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/ult_hw_config.h" #include "shared/test/common/helpers/variable_backup.h" +#include "shared/test/common/mocks/linux/mock_drm_command_stream_receiver.h" #include "shared/test/common/mocks/linux/mock_drm_memory_manager.h" #include "shared/test/common/mocks/mock_builtins.h" #include "shared/test/common/mocks/mock_device.h" #include "shared/test/common/mocks/mock_execution_environment.h" - -#include "opencl/test/unit_test/fixtures/memory_management_fixture.h" -#include "opencl/test/unit_test/mocks/linux/mock_drm_command_stream_receiver.h" -#include "opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h" +#include "shared/test/common/os_interface/linux/device_command_stream_fixture.h" #include diff --git a/shared/test/unit_test/direct_submission/linux/drm_direct_submission_tests.cpp b/shared/test/unit_test/direct_submission/linux/drm_direct_submission_tests.cpp index eb4ee2cb95..04591fa49d 100644 --- a/shared/test/unit_test/direct_submission/linux/drm_direct_submission_tests.cpp +++ b/shared/test/unit_test/direct_submission/linux/drm_direct_submission_tests.cpp @@ -18,8 +18,8 @@ #include "shared/test/common/libult/linux/drm_mock.h" #include "shared/test/common/libult/ult_command_stream_receiver.h" #include "shared/test/common/mocks/mock_device.h" +#include "shared/test/common/os_interface/linux/drm_memory_manager_tests.h" -#include "opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.h" #include "test.h" #include