From 718776974447455fe770a6d724282be00211607c Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Wed, 6 Oct 2021 11:43:42 +0000 Subject: [PATCH] Move kernel binary helpers to shared Signed-off-by: Mateusz Jablonski --- level_zero/core/test/aub_tests/CMakeLists.txt | 1 - level_zero/core/test/unit_tests/CMakeLists.txt | 1 - .../core/test/unit_tests/mocks/mock_device_for_spirv.cpp | 3 +-- level_zero/experimental/test/unit_tests/CMakeLists.txt | 1 - level_zero/tools/test/unit_tests/CMakeLists.txt | 1 - opencl/test/unit_test/api/cl_build_program_tests.inl | 2 +- opencl/test/unit_test/api/cl_compile_program_tests.inl | 2 +- .../test/unit_test/api/cl_get_kernel_arg_info_tests.inl | 2 +- opencl/test/unit_test/api/cl_get_kernel_info_tests.inl | 2 +- .../unit_test/api/cl_get_program_build_info_tests.inl | 2 +- opencl/test/unit_test/api/cl_get_program_info_tests.inl | 2 +- .../command_queue/enqueue_debug_kernel_tests.cpp | 4 ++-- .../unit_test/command_queue/enqueue_kernel_1_tests.cpp | 2 +- opencl/test/unit_test/fixtures/built_in_fixture.cpp | 3 +-- .../unit_test/fixtures/kernel_work_group_info_fixture.h | 2 +- opencl/test/unit_test/gtpin/gtpin_tests.cpp | 2 +- opencl/test/unit_test/helpers/CMakeLists.txt | 1 - opencl/test/unit_test/kernel/kernel_arg_info_tests.cpp | 3 ++- opencl/test/unit_test/libult/CMakeLists.txt | 3 --- opencl/test/unit_test/main.cpp | 3 +-- opencl/test/unit_test/mem_obj/image_tests.cpp | 2 +- opencl/test/unit_test/mem_obj/nv12_image_tests.cpp | 2 +- opencl/test/unit_test/program/program_tests.cpp | 2 +- .../unit_test/program/program_with_kernel_debug_tests.cpp | 4 ++-- opencl/test/unit_test/program/program_with_source.h | 2 +- shared/test/common/helpers/CMakeLists.txt | 3 +++ .../test/common}/helpers/kernel_binary_helper.cpp | 2 +- .../test/common}/helpers/kernel_binary_helper.h | 0 .../common}/helpers/kernel_binary_helper_hash_value.cpp | 2 +- .../test/common}/helpers/kernel_filename_helper.h | 2 +- shared/test/common/libult/CMakeLists.txt | 4 ++++ shared/test/common/libult/global_environment.cpp | 1 + .../test/common/mocks/mock_compiler_interface_spirv.cpp | 3 +-- shared/test/unit_test/CMakeLists.txt | 2 -- shared/test/unit_test/main.cpp | 8 +++----- 35 files changed, 37 insertions(+), 44 deletions(-) rename {opencl/test/unit_test => shared/test/common}/helpers/kernel_binary_helper.cpp (93%) rename {opencl/test/unit_test => shared/test/common}/helpers/kernel_binary_helper.h (100%) rename {opencl/test/unit_test => shared/test/common}/helpers/kernel_binary_helper_hash_value.cpp (80%) rename {opencl/test/unit_test => shared/test/common}/helpers/kernel_filename_helper.h (91%) diff --git a/level_zero/core/test/aub_tests/CMakeLists.txt b/level_zero/core/test/aub_tests/CMakeLists.txt index 24371f4a02..4016f16984 100644 --- a/level_zero/core/test/aub_tests/CMakeLists.txt +++ b/level_zero/core/test/aub_tests/CMakeLists.txt @@ -82,7 +82,6 @@ if(TARGET ${BUILTINS_SPIRV_LIB_NAME}) endif() target_sources(${TARGET_NAME} PRIVATE - ${NEO_SOURCE_DIR}/opencl/test/unit_test/helpers${BRANCH_DIR_SUFFIX}kernel_binary_helper_hash_value.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/libult/io_functions.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/abort.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/mocks/mock_gmm_page_table_mngr.cpp diff --git a/level_zero/core/test/unit_tests/CMakeLists.txt b/level_zero/core/test/unit_tests/CMakeLists.txt index 30f2645016..cfb1c227c4 100644 --- a/level_zero/core/test/unit_tests/CMakeLists.txt +++ b/level_zero/core/test/unit_tests/CMakeLists.txt @@ -24,7 +24,6 @@ add_executable(${TARGET_NAME} ${NEO_SOURCE_DIR}/shared/test/common/mocks/ult_device_factory.cpp ${NEO_SOURCE_DIR}/shared/test/common/mocks/ult_device_factory.h ${NEO_SOURCE_DIR}/level_zero/tools/test/unit_tests/sources/debug/debug_session_helper.cpp - ${NEO_SOURCE_DIR}/opencl/test/unit_test/helpers/kernel_binary_helper_hash_value.cpp ) target_sources(${TARGET_NAME} PRIVATE diff --git a/level_zero/core/test/unit_tests/mocks/mock_device_for_spirv.cpp b/level_zero/core/test/unit_tests/mocks/mock_device_for_spirv.cpp index 9ec142d867..e33e32b650 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_device_for_spirv.cpp +++ b/level_zero/core/test/unit_tests/mocks/mock_device_for_spirv.cpp @@ -8,11 +8,10 @@ #include "level_zero/core/test/unit_tests/mocks/mock_device_for_spirv.h" #include "shared/source/helpers/file_io.h" +#include "shared/test/common/helpers/kernel_binary_helper.h" #include "shared/test/common/helpers/test_files.h" #include "shared/test/common/libult/global_environment.h" -#include "opencl/test/unit_test/helpers/kernel_binary_helper.h" - #include "level_zero/tools/source/debug/debug_session.h" namespace L0 { diff --git a/level_zero/experimental/test/unit_tests/CMakeLists.txt b/level_zero/experimental/test/unit_tests/CMakeLists.txt index 5d7c370526..e6ce6190ff 100644 --- a/level_zero/experimental/test/unit_tests/CMakeLists.txt +++ b/level_zero/experimental/test/unit_tests/CMakeLists.txt @@ -27,7 +27,6 @@ add_executable( ${NEO_SOURCE_DIR}/level_zero/core/source/dll/disallow_deferred_deleter.cpp ${NEO_SOURCE_DIR}/shared/test/common/mocks/ult_device_factory.cpp ${NEO_SOURCE_DIR}/shared/test/common/mocks/ult_device_factory.h - ${NEO_SOURCE_DIR}/opencl/test/unit_test/helpers/kernel_binary_helper_hash_value.cpp ${NEO_SOURCE_DIR}/level_zero/core/test/unit_tests/sources/builtin/create_ult_builtin_functions_lib.cpp ${NEO_SOURCE_DIR}/level_zero/tools/test/unit_tests/sources/debug/debug_session_helper.cpp ) diff --git a/level_zero/tools/test/unit_tests/CMakeLists.txt b/level_zero/tools/test/unit_tests/CMakeLists.txt index 7fd0f8ae9e..d24de44009 100644 --- a/level_zero/tools/test/unit_tests/CMakeLists.txt +++ b/level_zero/tools/test/unit_tests/CMakeLists.txt @@ -37,7 +37,6 @@ target_sources(${TARGET_NAME} PRIVATE ) target_sources(${TARGET_NAME} PRIVATE - ${COMPUTE_RUNTIME_DIR}/opencl/test/unit_test/helpers${BRANCH_DIR_SUFFIX}kernel_binary_helper_hash_value.cpp ${COMPUTE_RUNTIME_DIR}/opencl/test/unit_test/libult/io_functions.cpp $ $ diff --git a/opencl/test/unit_test/api/cl_build_program_tests.inl b/opencl/test/unit_test/api/cl_build_program_tests.inl index 7948b72792..7aaa33fe73 100644 --- a/opencl/test/unit_test/api/cl_build_program_tests.inl +++ b/opencl/test/unit_test/api/cl_build_program_tests.inl @@ -9,12 +9,12 @@ #include "shared/source/device/device.h" #include "shared/source/helpers/file_io.h" #include "shared/source/program/kernel_info.h" +#include "shared/test/common/helpers/kernel_binary_helper.h" #include "shared/test/common/helpers/test_files.h" #include "shared/test/common/mocks/mock_compilers.h" #include "opencl/source/context/context.h" #include "opencl/source/program/program.h" -#include "opencl/test/unit_test/helpers/kernel_binary_helper.h" #include "cl_api_tests.h" diff --git a/opencl/test/unit_test/api/cl_compile_program_tests.inl b/opencl/test/unit_test/api/cl_compile_program_tests.inl index e3f3bcdf9d..a4bb7ee509 100644 --- a/opencl/test/unit_test/api/cl_compile_program_tests.inl +++ b/opencl/test/unit_test/api/cl_compile_program_tests.inl @@ -7,10 +7,10 @@ #include "shared/source/compiler_interface/compiler_interface.h" #include "shared/source/helpers/file_io.h" +#include "shared/test/common/helpers/kernel_binary_helper.h" #include "shared/test/common/helpers/test_files.h" #include "opencl/source/context/context.h" -#include "opencl/test/unit_test/helpers/kernel_binary_helper.h" #include "cl_api_tests.h" diff --git a/opencl/test/unit_test/api/cl_get_kernel_arg_info_tests.inl b/opencl/test/unit_test/api/cl_get_kernel_arg_info_tests.inl index 72c91e86c2..49dcb1b73d 100644 --- a/opencl/test/unit_test/api/cl_get_kernel_arg_info_tests.inl +++ b/opencl/test/unit_test/api/cl_get_kernel_arg_info_tests.inl @@ -8,10 +8,10 @@ #include "shared/source/compiler_interface/compiler_interface.h" #include "shared/source/device/device.h" #include "shared/source/helpers/file_io.h" +#include "shared/test/common/helpers/kernel_binary_helper.h" #include "shared/test/common/helpers/test_files.h" #include "opencl/source/context/context.h" -#include "opencl/test/unit_test/helpers/kernel_binary_helper.h" #include "cl_api_tests.h" #include "compiler_options.h" diff --git a/opencl/test/unit_test/api/cl_get_kernel_info_tests.inl b/opencl/test/unit_test/api/cl_get_kernel_info_tests.inl index 51fe50ad3d..a41c4562a2 100644 --- a/opencl/test/unit_test/api/cl_get_kernel_info_tests.inl +++ b/opencl/test/unit_test/api/cl_get_kernel_info_tests.inl @@ -8,10 +8,10 @@ #include "shared/source/compiler_interface/compiler_interface.h" #include "shared/source/device/device.h" #include "shared/source/helpers/file_io.h" +#include "shared/test/common/helpers/kernel_binary_helper.h" #include "shared/test/common/helpers/test_files.h" #include "opencl/source/context/context.h" -#include "opencl/test/unit_test/helpers/kernel_binary_helper.h" #include "cl_api_tests.h" diff --git a/opencl/test/unit_test/api/cl_get_program_build_info_tests.inl b/opencl/test/unit_test/api/cl_get_program_build_info_tests.inl index 92f5463129..96999f25f7 100644 --- a/opencl/test/unit_test/api/cl_get_program_build_info_tests.inl +++ b/opencl/test/unit_test/api/cl_get_program_build_info_tests.inl @@ -12,10 +12,10 @@ #include "shared/source/device_binary_format/elf/elf_encoder.h" #include "shared/source/device_binary_format/elf/ocl_elf.h" #include "shared/source/helpers/file_io.h" +#include "shared/test/common/helpers/kernel_binary_helper.h" #include "shared/test/common/helpers/test_files.h" #include "opencl/source/context/context.h" -#include "opencl/test/unit_test/helpers/kernel_binary_helper.h" #include "cl_api_tests.h" diff --git a/opencl/test/unit_test/api/cl_get_program_info_tests.inl b/opencl/test/unit_test/api/cl_get_program_info_tests.inl index 4a855e3850..bac814b40d 100644 --- a/opencl/test/unit_test/api/cl_get_program_info_tests.inl +++ b/opencl/test/unit_test/api/cl_get_program_info_tests.inl @@ -8,11 +8,11 @@ #include "shared/source/compiler_interface/compiler_interface.h" #include "shared/source/device/device.h" #include "shared/source/helpers/file_io.h" +#include "shared/test/common/helpers/kernel_binary_helper.h" #include "shared/test/common/helpers/test_files.h" #include "opencl/source/context/context.h" #include "opencl/test/unit_test/fixtures/run_kernel_fixture.h" -#include "opencl/test/unit_test/helpers/kernel_binary_helper.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/command_queue/enqueue_debug_kernel_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_debug_kernel_tests.cpp index c931454c21..e3ffe8a893 100644 --- a/opencl/test/unit_test/command_queue/enqueue_debug_kernel_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_debug_kernel_tests.cpp @@ -7,13 +7,13 @@ #include "shared/source/os_interface/os_context.h" #include "shared/source/source_level_debugger/source_level_debugger.h" +#include "shared/test/common/helpers/kernel_binary_helper.h" +#include "shared/test/common/helpers/kernel_filename_helper.h" #include "shared/test/common/helpers/unit_test_helper.h" #include "opencl/source/command_queue/command_queue.h" #include "opencl/source/program/program.h" #include "opencl/test/unit_test/fixtures/enqueue_handler_fixture.h" -#include "opencl/test/unit_test/helpers/kernel_binary_helper.h" -#include "opencl/test/unit_test/helpers/kernel_filename_helper.h" #include "opencl/test/unit_test/mocks/mock_buffer.h" #include "opencl/test/unit_test/mocks/mock_command_queue.h" #include "opencl/test/unit_test/mocks/mock_kernel.h" diff --git a/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp index 095bdffe03..e9e01e766a 100644 --- a/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp @@ -9,6 +9,7 @@ #include "shared/source/helpers/preamble.h" #include "shared/test/common/cmd_parse/hw_parse.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" #include "opencl/source/api/api.h" @@ -16,7 +17,6 @@ #include "opencl/test/unit_test/api/cl_api_tests.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/helpers/kernel_binary_helper.h" #include "opencl/test/unit_test/mocks/mock_csr.h" #include "opencl/test/unit_test/mocks/mock_submissions_aggregator.h" #include "opencl/test/unit_test/test_macros/test_checks_ocl.h" diff --git a/opencl/test/unit_test/fixtures/built_in_fixture.cpp b/opencl/test/unit_test/fixtures/built_in_fixture.cpp index 84047d0aa3..d7587fbbfc 100644 --- a/opencl/test/unit_test/fixtures/built_in_fixture.cpp +++ b/opencl/test/unit_test/fixtures/built_in_fixture.cpp @@ -9,12 +9,11 @@ #include "shared/source/built_ins/built_ins.h" #include "shared/source/device/device.h" +#include "shared/test/common/helpers/kernel_binary_helper.h" #include "shared/test/common/helpers/test_files.h" #include "shared/test/common/libult/global_environment.h" #include "shared/test/common/test_macros/test_checks_shared.h" -#include "opencl/test/unit_test/helpers/kernel_binary_helper.h" - using namespace NEO; void BuiltInFixture::SetUp(Device *pDevice) { diff --git a/opencl/test/unit_test/fixtures/kernel_work_group_info_fixture.h b/opencl/test/unit_test/fixtures/kernel_work_group_info_fixture.h index 297955d123..59a582ba0e 100644 --- a/opencl/test/unit_test/fixtures/kernel_work_group_info_fixture.h +++ b/opencl/test/unit_test/fixtures/kernel_work_group_info_fixture.h @@ -7,10 +7,10 @@ #pragma once #include "shared/source/helpers/file_io.h" +#include "shared/test/common/helpers/kernel_binary_helper.h" #include "shared/test/common/helpers/test_files.h" #include "opencl/test/unit_test/api/cl_api_tests.h" -#include "opencl/test/unit_test/helpers/kernel_binary_helper.h" #include "test.h" using namespace NEO; diff --git a/opencl/test/unit_test/gtpin/gtpin_tests.cpp b/opencl/test/unit_test/gtpin/gtpin_tests.cpp index 4420c9d1dc..2e79a4d6e3 100644 --- a/opencl/test/unit_test/gtpin/gtpin_tests.cpp +++ b/opencl/test/unit_test/gtpin/gtpin_tests.cpp @@ -14,6 +14,7 @@ #include "shared/source/memory_manager/unified_memory_manager.h" #include "shared/source/os_interface/os_context.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" #include "shared/test/common/helpers/variable_backup.h" #include "shared/test/common/mocks/mock_device.h" @@ -35,7 +36,6 @@ #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/helpers/kernel_binary_helper.h" #include "opencl/test/unit_test/mocks/mock_buffer.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/helpers/CMakeLists.txt b/opencl/test/unit_test/helpers/CMakeLists.txt index 2d2583b699..d2c3547549 100644 --- a/opencl/test/unit_test/helpers/CMakeLists.txt +++ b/opencl/test/unit_test/helpers/CMakeLists.txt @@ -21,7 +21,6 @@ set(IGDRCL_SRCS_tests_helpers ${CMAKE_CURRENT_SOURCE_DIR}/hw_helper_default_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/hw_helper_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/hw_helper_tests.h - ${CMAKE_CURRENT_SOURCE_DIR}/kernel_filename_helper.h ${CMAKE_CURRENT_SOURCE_DIR}/kmd_notify_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/memory_management_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/memory_properties_helpers_tests.cpp 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 e9729820c1..157a107de2 100644 --- a/opencl/test/unit_test/kernel/kernel_arg_info_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_arg_info_tests.cpp @@ -5,10 +5,11 @@ * */ +#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/helpers/kernel_binary_helper.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/libult/CMakeLists.txt b/opencl/test/unit_test/libult/CMakeLists.txt index 08cf481a7d..39c1eb0b24 100644 --- a/opencl/test/unit_test/libult/CMakeLists.txt +++ b/opencl/test/unit_test/libult/CMakeLists.txt @@ -53,9 +53,6 @@ set(IGDRCL_SRCS_LIB_ULT_ENV ${NEO_SOURCE_DIR}/opencl/test/unit_test/fixtures/cl_device_fixture.h ${NEO_SOURCE_DIR}/opencl/test/unit_test/fixtures/program_fixture.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/fixtures/program_fixture.h - ${NEO_SOURCE_DIR}/opencl/test/unit_test/helpers/kernel_binary_helper.cpp - ${NEO_SOURCE_DIR}/opencl/test/unit_test/helpers/kernel_binary_helper.h - ${NEO_SOURCE_DIR}/opencl/test/unit_test/helpers${BRANCH_DIR_SUFFIX}kernel_binary_helper_hash_value.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/indirect_heap/indirect_heap_fixture.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/indirect_heap/indirect_heap_fixture.h ${NEO_SOURCE_DIR}/opencl/test/unit_test/ult_config_listener.cpp diff --git a/opencl/test/unit_test/main.cpp b/opencl/test/unit_test/main.cpp index a2f9812966..7773d644cf 100644 --- a/opencl/test/unit_test/main.cpp +++ b/opencl/test/unit_test/main.cpp @@ -13,6 +13,7 @@ #include "shared/source/utilities/debug_settings_reader.h" #include "shared/test/common/helpers/custom_event_listener.h" #include "shared/test/common/helpers/default_hw_info.inl" +#include "shared/test/common/helpers/kernel_binary_helper.h" #include "shared/test/common/helpers/memory_leak_listener.h" #include "shared/test/common/helpers/test_files.h" #include "shared/test/common/helpers/ult_hw_config.inl" @@ -24,7 +25,6 @@ #include "opencl/source/os_interface/ocl_reg_path.h" #include "opencl/source/platform/platform.h" -#include "opencl/test/unit_test/helpers/kernel_binary_helper.h" #include "opencl/test/unit_test/mocks/mock_gmm.h" #include "opencl/test/unit_test/mocks/mock_program.h" #include "opencl/test/unit_test/ult_config_listener.h" @@ -62,7 +62,6 @@ bool disabled = false; } // namespace NEO using namespace NEO; -TestEnvironment *gEnvironment; PRODUCT_FAMILY productFamily = DEFAULT_TEST_PLATFORM::hwInfo.platform.eProductFamily; GFXCORE_FAMILY renderCoreFamily = DEFAULT_TEST_PLATFORM::hwInfo.platform.eRenderCoreFamily; diff --git a/opencl/test/unit_test/mem_obj/image_tests.cpp b/opencl/test/unit_test/mem_obj/image_tests.cpp index 12b09f5b19..475335bb99 100644 --- a/opencl/test/unit_test/mem_obj/image_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image_tests.cpp @@ -11,6 +11,7 @@ #include "shared/source/image/image_surface_state.h" #include "shared/source/os_interface/os_context.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" #include "shared/test/common/mocks/mock_memory_manager.h" #include "shared/test/common/test_macros/test_checks_shared.h" @@ -23,7 +24,6 @@ #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/helpers/kernel_binary_helper.h" #include "opencl/test/unit_test/mem_obj/image_compression_fixture.h" #include "opencl/test/unit_test/mocks/mock_allocation_properties.h" #include "opencl/test/unit_test/mocks/mock_context.h" diff --git a/opencl/test/unit_test/mem_obj/nv12_image_tests.cpp b/opencl/test/unit_test/mem_obj/nv12_image_tests.cpp index 38f35fbad8..7dce0bb4e4 100644 --- a/opencl/test/unit_test/mem_obj/nv12_image_tests.cpp +++ b/opencl/test/unit_test/mem_obj/nv12_image_tests.cpp @@ -8,6 +8,7 @@ #include "shared/source/gmm_helper/gmm.h" #include "shared/source/helpers/aligned_memory.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/test/common/helpers/kernel_binary_helper.h" #include "opencl/source/cl_device/cl_device_get_cap.inl" #include "opencl/source/helpers/memory_properties_helpers.h" @@ -15,7 +16,6 @@ #include "opencl/source/mem_obj/image.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/helpers/kernel_binary_helper.h" #include "opencl/test/unit_test/mocks/mock_buffer.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/program/program_tests.cpp b/opencl/test/unit_test/program/program_tests.cpp index ec4abcf0b2..96839298d9 100644 --- a/opencl/test/unit_test/program/program_tests.cpp +++ b/opencl/test/unit_test/program/program_tests.cpp @@ -23,6 +23,7 @@ #include "shared/source/memory_manager/surface.h" #include "shared/source/os_interface/os_context.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/test/common/helpers/kernel_binary_helper.h" #include "shared/test/common/libult/global_environment.h" #include "shared/test/common/mocks/mock_compiler_interface.h" #include "shared/test/common/mocks/mock_graphics_allocation.h" @@ -36,7 +37,6 @@ #include "opencl/source/program/create.inl" #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" #include "opencl/test/unit_test/fixtures/multi_root_device_fixture.h" -#include "opencl/test/unit_test/helpers/kernel_binary_helper.h" #include "opencl/test/unit_test/libult/ult_command_stream_receiver.h" #include "opencl/test/unit_test/mocks/mock_allocation_properties.h" #include "opencl/test/unit_test/mocks/mock_kernel.h" diff --git a/opencl/test/unit_test/program/program_with_kernel_debug_tests.cpp b/opencl/test/unit_test/program/program_with_kernel_debug_tests.cpp index 4843fe5ab0..e257f1d32e 100644 --- a/opencl/test/unit_test/program/program_with_kernel_debug_tests.cpp +++ b/opencl/test/unit_test/program/program_with_kernel_debug_tests.cpp @@ -6,11 +6,11 @@ */ #include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/test/common/helpers/kernel_binary_helper.h" +#include "shared/test/common/helpers/kernel_filename_helper.h" #include "shared/test/common/libult/global_environment.h" #include "opencl/test/unit_test/fixtures/program_fixture.h" -#include "opencl/test/unit_test/helpers/kernel_binary_helper.h" -#include "opencl/test/unit_test/helpers/kernel_filename_helper.h" #include "opencl/test/unit_test/mocks/mock_program.h" #include "opencl/test/unit_test/mocks/mock_source_level_debugger.h" #include "opencl/test/unit_test/program/program_from_binary.h" diff --git a/opencl/test/unit_test/program/program_with_source.h b/opencl/test/unit_test/program/program_with_source.h index 2ed8399144..3f47f56d63 100644 --- a/opencl/test/unit_test/program/program_with_source.h +++ b/opencl/test/unit_test/program/program_with_source.h @@ -8,12 +8,12 @@ #pragma once #include "shared/source/compiler_interface/compiler_interface.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/helpers/kernel_binary_helper.h" #include "opencl/test/unit_test/mocks/mock_context.h" namespace NEO { diff --git a/shared/test/common/helpers/CMakeLists.txt b/shared/test/common/helpers/CMakeLists.txt index b8ea7e1ab2..2776047823 100644 --- a/shared/test/common/helpers/CMakeLists.txt +++ b/shared/test/common/helpers/CMakeLists.txt @@ -20,6 +20,9 @@ set(NEO_CORE_HELPERS_TESTS ${CMAKE_CURRENT_SOURCE_DIR}/file_io_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}hw_helper_extended_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/hash_tests.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/kernel_binary_helper.h + ${CMAKE_CURRENT_SOURCE_DIR}/kernel_filename_helper.h + ${CMAKE_CURRENT_SOURCE_DIR}/kernel_helpers_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/kernel_helpers_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/memory_leak_listener.h ${CMAKE_CURRENT_SOURCE_DIR}/memory_management.h diff --git a/opencl/test/unit_test/helpers/kernel_binary_helper.cpp b/shared/test/common/helpers/kernel_binary_helper.cpp similarity index 93% rename from opencl/test/unit_test/helpers/kernel_binary_helper.cpp rename to shared/test/common/helpers/kernel_binary_helper.cpp index 979d2a579a..a9a5cd33c9 100644 --- a/opencl/test/unit_test/helpers/kernel_binary_helper.cpp +++ b/shared/test/common/helpers/kernel_binary_helper.cpp @@ -5,7 +5,7 @@ * */ -#include "opencl/test/unit_test/helpers/kernel_binary_helper.h" +#include "shared/test/common/helpers/kernel_binary_helper.h" #include "shared/test/common/helpers/test_files.h" #include "shared/test/common/libult/global_environment.h" diff --git a/opencl/test/unit_test/helpers/kernel_binary_helper.h b/shared/test/common/helpers/kernel_binary_helper.h similarity index 100% rename from opencl/test/unit_test/helpers/kernel_binary_helper.h rename to shared/test/common/helpers/kernel_binary_helper.h diff --git a/opencl/test/unit_test/helpers/kernel_binary_helper_hash_value.cpp b/shared/test/common/helpers/kernel_binary_helper_hash_value.cpp similarity index 80% rename from opencl/test/unit_test/helpers/kernel_binary_helper_hash_value.cpp rename to shared/test/common/helpers/kernel_binary_helper_hash_value.cpp index d87b1ab3f4..a3a1571c20 100644 --- a/opencl/test/unit_test/helpers/kernel_binary_helper_hash_value.cpp +++ b/shared/test/common/helpers/kernel_binary_helper_hash_value.cpp @@ -5,7 +5,7 @@ * */ -#include "opencl/test/unit_test/helpers/kernel_binary_helper.h" +#include "shared/test/common/helpers/kernel_binary_helper.h" const std::string KernelBinaryHelper::BUILT_INS("7836643072362489210"); const std::string KernelBinaryHelper::BUILT_INS_WITH_IMAGES("10613492505254921609_images"); diff --git a/opencl/test/unit_test/helpers/kernel_filename_helper.h b/shared/test/common/helpers/kernel_filename_helper.h similarity index 91% rename from opencl/test/unit_test/helpers/kernel_filename_helper.h rename to shared/test/common/helpers/kernel_filename_helper.h index 98a9834765..349399fa8a 100644 --- a/opencl/test/unit_test/helpers/kernel_filename_helper.h +++ b/shared/test/common/helpers/kernel_filename_helper.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Intel Corporation + * Copyright (C) 2018-2021 Intel Corporation * * SPDX-License-Identifier: MIT * diff --git a/shared/test/common/libult/CMakeLists.txt b/shared/test/common/libult/CMakeLists.txt index 89844926fe..c99e14c83a 100644 --- a/shared/test/common/libult/CMakeLists.txt +++ b/shared/test/common/libult/CMakeLists.txt @@ -55,6 +55,10 @@ set(igdrcl_libult_common_SRCS_LIB_ULT ${NEO_SHARED_TEST_DIRECTORY}/common/fixtures/device_fixture.h ${NEO_SHARED_TEST_DIRECTORY}/common/fixtures/mock_execution_environment_gmm_fixture.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/fixtures/mock_execution_environment_gmm_fixture.h + ${NEO_SHARED_TEST_DIRECTORY}/common/helpers${BRANCH_DIR_SUFFIX}kernel_binary_helper_hash_value.cpp + ${NEO_SHARED_TEST_DIRECTORY}/common/helpers/kernel_binary_helper.cpp + ${NEO_SHARED_TEST_DIRECTORY}/common/helpers/kernel_binary_helper.h + ${NEO_SHARED_TEST_DIRECTORY}/common/helpers/kernel_filename_helper.h ${NEO_SHARED_TEST_DIRECTORY}/common/helpers/memory_leak_listener.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/helpers/memory_leak_listener.h ${NEO_SHARED_TEST_DIRECTORY}/common/helpers/memory_management.cpp diff --git a/shared/test/common/libult/global_environment.cpp b/shared/test/common/libult/global_environment.cpp index f6a97ff5bf..b80c012ba7 100644 --- a/shared/test/common/libult/global_environment.cpp +++ b/shared/test/common/libult/global_environment.cpp @@ -10,6 +10,7 @@ #include "shared/source/helpers/hw_info.h" #include "shared/source/os_interface/os_inc_base.h" +TestEnvironment *gEnvironment; TestEnvironment::TestEnvironment() { igcDebugVarStack.reserve(3); fclDebugVarStack.reserve(3); diff --git a/shared/test/common/mocks/mock_compiler_interface_spirv.cpp b/shared/test/common/mocks/mock_compiler_interface_spirv.cpp index a2a751b064..f50a076172 100644 --- a/shared/test/common/mocks/mock_compiler_interface_spirv.cpp +++ b/shared/test/common/mocks/mock_compiler_interface_spirv.cpp @@ -8,11 +8,10 @@ #include "shared/test/common/mocks/mock_compiler_interface_spirv.h" #include "shared/source/helpers/file_io.h" +#include "shared/test/common/helpers/kernel_binary_helper.h" #include "shared/test/common/helpers/test_files.h" #include "shared/test/common/libult/global_environment.h" -#include "opencl/test/unit_test/helpers/kernel_binary_helper.h" - namespace NEO { TranslationOutput::ErrorCode MockCompilerInterfaceSpirv::compile(const NEO::Device &device, const TranslationInput &input, TranslationOutput &output) { std::string kernelName; diff --git a/shared/test/unit_test/CMakeLists.txt b/shared/test/unit_test/CMakeLists.txt index 68d4dd2d9e..b1b82060ec 100644 --- a/shared/test/unit_test/CMakeLists.txt +++ b/shared/test/unit_test/CMakeLists.txt @@ -28,9 +28,7 @@ if(NOT SKIP_UNIT_TESTS) ${CMAKE_CURRENT_SOURCE_DIR}/test_mode.h ${CMAKE_CURRENT_SOURCE_DIR}/tests_configuration.h ${NEO_SOURCE_DIR}/opencl/source/compiler_interface/default_cache_config.cpp - ${NEO_SOURCE_DIR}/opencl/test/unit_test/helpers/kernel_binary_helper_hash_value.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/libult/io_functions.cpp - ${NEO_SOURCE_DIR}/opencl/test/unit_test/test_macros/test_checks_ocl.cpp ${NEO_SHARED_DIRECTORY}/helpers/allow_deferred_deleter.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/helpers/api_specific_config_shared_tests.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/test_macros/test_checks_shared.cpp diff --git a/shared/test/unit_test/main.cpp b/shared/test/unit_test/main.cpp index 5e3078180c..c507aeeec5 100644 --- a/shared/test/unit_test/main.cpp +++ b/shared/test/unit_test/main.cpp @@ -9,10 +9,12 @@ #include "shared/source/gmm_helper/gmm_helper.h" #include "shared/source/gmm_helper/gmm_interface.h" #include "shared/source/gmm_helper/resource_info.h" +#include "shared/source/helpers/api_specific_config.h" #include "shared/source/os_interface/hw_info_config.h" #include "shared/source/utilities/debug_settings_reader.h" #include "shared/test/common/helpers/custom_event_listener.h" #include "shared/test/common/helpers/default_hw_info.inl" +#include "shared/test/common/helpers/kernel_binary_helper.h" #include "shared/test/common/helpers/memory_leak_listener.h" #include "shared/test/common/helpers/test_files.h" #include "shared/test/common/helpers/ult_hw_config.inl" @@ -23,10 +25,7 @@ #include "shared/test/unit_test/base_ult_config_listener.h" #include "shared/test/unit_test/tests_configuration.h" -#include "opencl/source/os_interface/ocl_reg_path.h" -#include "opencl/test/unit_test/helpers/kernel_binary_helper.h" #include "opencl/test/unit_test/mocks/mock_gmm.h" -#include "opencl/test/unit_test/mocks/mock_program.h" #include "gmock/gmock.h" @@ -66,7 +65,6 @@ bool disabled = false; } // namespace NEO using namespace NEO; -TestEnvironment *gEnvironment; PRODUCT_FAMILY productFamily = DEFAULT_TEST_PLATFORM::hwInfo.platform.eProductFamily; GFXCORE_FAMILY renderCoreFamily = DEFAULT_TEST_PLATFORM::hwInfo.platform.eRenderCoreFamily; @@ -288,7 +286,7 @@ int main(int argc, char **argv) { generateRandomInput = true; } else if (!strcmp("--read-config", argv[i]) && (testMode == TestMode::AubTests || testMode == TestMode::AubTestsWithTbx)) { if (DebugManager.registryReadAvailable()) { - DebugManager.setReaderImpl(SettingsReader::create(oclRegPath)); + DebugManager.setReaderImpl(SettingsReader::create(ApiSpecificConfig::getRegistryPath())); DebugManager.injectSettingsFromReader(); } } else if (!strcmp("--dump_buffer_format", argv[i]) && testMode == TestMode::AubTests) {