From cf73ab0df351903808be210fa8f708bbf79bd955 Mon Sep 17 00:00:00 2001 From: Artur Harasimiuk Date: Wed, 28 Jun 2023 09:43:39 +0200 Subject: [PATCH] refactor: remove not used code Signed-off-by: Artur Harasimiuk --- cmake/setup_platform_flags.cmake | 25 +- .../source/xe_hp_core/xehp/CMakeLists.txt | 16 - .../source/xe_hp_core/xehp/cmdlist_xehp.cpp | 19 - .../source/xe_hp_core/xehp/cmdqueue_xehp.cpp | 19 - .../source/xe_hp_core/xehp/image_xehp.cpp | 23 -- .../source/xe_hp_core/xehp/kernel_xehp.cpp | 16 - .../source/xe_hp_core/xehp/sampler_xehp.cpp | 19 - .../unit_test/xe_hp_core/xehp/CMakeLists.txt | 31 -- .../xehp/cache_flush_tests_xehp.inl | 83 ----- .../xe_hp_core/xehp/get_device_info_xehp.inl | 86 ----- .../xehp/gfx_core_helper_tests_xehp.inl | 109 ------ .../xe_hp_core/xehp/hw_info_tests_xehp.inl | 91 ----- .../xe_hp_core/xehp/linux/CMakeLists.txt | 9 - .../xe_hp_core/xehp/linux/dll/CMakeLists.txt | 11 - .../xehp/linux/dll/device_id_tests_xehp.cpp | 31 -- .../xehp/memory_manager_tests_xehp.inl | 25 -- .../xe_hp_core/xehp/sampler_tests_xehp.inl | 46 --- .../source_level_debugger_csr_tests_xehp.cpp | 130 ------- .../xe_hp_core/xehp/test_buffer_xe_hp_sdv.inl | 323 ----------------- .../test_command_stream_receiver_xehp.inl | 142 -------- .../xe_hp_core/xehp/test_device_caps_xehp.inl | 39 -- .../xe_hp_core/xehp/test_image_xe_hp_sdv.inl | 339 ------------------ .../xehp/test_local_work_size_xehp.inl | 94 ----- .../xehp/test_platform_caps_xehp.inl | 28 -- .../xe_hp_core/xehp/test_preamble_xehp.cpp | 119 ------ .../xehp/test_product_helper_xehp.inl | 153 -------- .../xe_hp_core/xehp/test_sub_devices_xehp.inl | 62 ---- .../xe_hp_core/xehp/test_wrapper_xehp.cpp | 21 -- .../xe_hp_core/xe_hp_sdv/CMakeLists.txt | 16 - .../xe_hp_core/xe_hp_sdv/linux/CMakeLists.txt | 13 - .../linux/product_helper_tests_xe_hp_sdv.cpp | 38 -- .../product_helper_tests_xe_hp_sdv.cpp | 56 --- .../xe_hp_sdv/test_preamble_xe_hp_sdv.cpp | 164 --------- .../xe_hp_sdv/test_preemption_xe_hp_sdv.cpp | 102 ------ .../xe_hp_core/xe_hp_sdv/CMakeLists.txt | 9 - .../xe_hp_sdv/enable_xe_hp_sdv_testing.cmake | 10 - 36 files changed, 1 insertion(+), 2516 deletions(-) delete mode 100644 level_zero/core/source/xe_hp_core/xehp/CMakeLists.txt delete mode 100644 level_zero/core/source/xe_hp_core/xehp/cmdlist_xehp.cpp delete mode 100644 level_zero/core/source/xe_hp_core/xehp/cmdqueue_xehp.cpp delete mode 100644 level_zero/core/source/xe_hp_core/xehp/image_xehp.cpp delete mode 100644 level_zero/core/source/xe_hp_core/xehp/kernel_xehp.cpp delete mode 100644 level_zero/core/source/xe_hp_core/xehp/sampler_xehp.cpp delete mode 100644 opencl/test/unit_test/xe_hp_core/xehp/CMakeLists.txt delete mode 100644 opencl/test/unit_test/xe_hp_core/xehp/cache_flush_tests_xehp.inl delete mode 100644 opencl/test/unit_test/xe_hp_core/xehp/get_device_info_xehp.inl delete mode 100644 opencl/test/unit_test/xe_hp_core/xehp/gfx_core_helper_tests_xehp.inl delete mode 100644 opencl/test/unit_test/xe_hp_core/xehp/hw_info_tests_xehp.inl delete mode 100644 opencl/test/unit_test/xe_hp_core/xehp/linux/CMakeLists.txt delete mode 100644 opencl/test/unit_test/xe_hp_core/xehp/linux/dll/CMakeLists.txt delete mode 100644 opencl/test/unit_test/xe_hp_core/xehp/linux/dll/device_id_tests_xehp.cpp delete mode 100644 opencl/test/unit_test/xe_hp_core/xehp/memory_manager_tests_xehp.inl delete mode 100644 opencl/test/unit_test/xe_hp_core/xehp/sampler_tests_xehp.inl delete mode 100644 opencl/test/unit_test/xe_hp_core/xehp/source_level_debugger_csr_tests_xehp.cpp delete mode 100644 opencl/test/unit_test/xe_hp_core/xehp/test_buffer_xe_hp_sdv.inl delete mode 100644 opencl/test/unit_test/xe_hp_core/xehp/test_command_stream_receiver_xehp.inl delete mode 100644 opencl/test/unit_test/xe_hp_core/xehp/test_device_caps_xehp.inl delete mode 100644 opencl/test/unit_test/xe_hp_core/xehp/test_image_xe_hp_sdv.inl delete mode 100644 opencl/test/unit_test/xe_hp_core/xehp/test_local_work_size_xehp.inl delete mode 100644 opencl/test/unit_test/xe_hp_core/xehp/test_platform_caps_xehp.inl delete mode 100644 opencl/test/unit_test/xe_hp_core/xehp/test_preamble_xehp.cpp delete mode 100644 opencl/test/unit_test/xe_hp_core/xehp/test_product_helper_xehp.inl delete mode 100644 opencl/test/unit_test/xe_hp_core/xehp/test_sub_devices_xehp.inl delete mode 100644 opencl/test/unit_test/xe_hp_core/xehp/test_wrapper_xehp.cpp delete mode 100644 shared/test/unit_test/xe_hp_core/xe_hp_sdv/CMakeLists.txt delete mode 100644 shared/test/unit_test/xe_hp_core/xe_hp_sdv/linux/CMakeLists.txt delete mode 100644 shared/test/unit_test/xe_hp_core/xe_hp_sdv/linux/product_helper_tests_xe_hp_sdv.cpp delete mode 100644 shared/test/unit_test/xe_hp_core/xe_hp_sdv/product_helper_tests_xe_hp_sdv.cpp delete mode 100644 shared/test/unit_test/xe_hp_core/xe_hp_sdv/test_preamble_xe_hp_sdv.cpp delete mode 100644 shared/test/unit_test/xe_hp_core/xe_hp_sdv/test_preemption_xe_hp_sdv.cpp delete mode 100644 target_unit_tests/xe_hp_core/xe_hp_sdv/CMakeLists.txt delete mode 100644 target_unit_tests/xe_hp_core/xe_hp_sdv/enable_xe_hp_sdv_testing.cmake diff --git a/cmake/setup_platform_flags.cmake b/cmake/setup_platform_flags.cmake index 90e4ba6da0..decc314d05 100644 --- a/cmake/setup_platform_flags.cmake +++ b/cmake/setup_platform_flags.cmake @@ -1,5 +1,5 @@ # -# Copyright (C) 2020-2022 Intel Corporation +# Copyright (C) 2020-2023 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -14,12 +14,10 @@ if(NOT NEO_ALLOW_LEGACY_PLATFORMS_SUPPORT) SET_FLAGS_FOR("GEN9" "SKL" "KBL" "BXT" "GLK" "CFL") SET_FLAGS_FOR("GEN11" "ICLLP" "LKF" "EHL") endif() - DISABLE_FLAGS_FOR("XE_HP_CORE" "XE_HP_SDV") else() SET_FLAGS_FOR("GEN8" "BDW") SET_FLAGS_FOR("GEN9" "SKL" "KBL" "BXT" "GLK" "CFL") SET_FLAGS_FOR("GEN11" "ICLLP" "LKF" "EHL") - SET_FLAGS_FOR("XE_HP_CORE" "XE_HP_SDV") endif() SET_FLAGS_FOR("GEN12LP" "TGLLP" "RKL" "ADLS" "ADLP" "DG1" "ADLN") SET_FLAGS_FOR("XE_HPG_CORE" "DG2" "MTL") @@ -265,27 +263,6 @@ if(SUPPORT_GEN12LP) endif() endif() -if(SUPPORT_XE_HP_CORE) - if(TESTS_XE_HP_CORE) - if(TESTS_XE_HP_SDV) - ADD_ITEM_FOR_CORE_TYPE("FAMILY_NAME" "TESTED" "XE_HP_CORE" "XeHpFamily") - else() - set(TESTS_XE_HP_CORE FALSE) - endif() - endif() - if(SUPPORT_XE_HP_SDV) - set(XE_HP_SDV_XE_HP_CORE_REVISIONS 4) - ADD_PRODUCT("SUPPORTED" "XE_HP_SDV" "IGFX_XE_HP_SDV") - ADD_PLATFORM_FOR_CORE_TYPE("SUPPORTED" "XE_HP_CORE" "XE_HP_SDV") - ADD_PLATFORM_FOR_CORE_TYPE("SUPPORTED_IMAGES" "XE_HP_CORE" "XE_HP_SDV") - ADD_PLATFORM_FOR_CORE_TYPE("SUPPORTED_AUX_TRANSLATION" "XE_HP_CORE" "XE_HP_SDV") - if(TESTS_XE_HP_SDV) - ADD_ITEM_FOR_CORE_TYPE("PLATFORMS" "TESTED" "XE_HP_CORE" "XE_HP_SDV") - ADD_PRODUCT("TESTED" "XE_HP_SDV" "IGFX_XE_HP_SDV") - endif() - endif() -endif() - if(SUPPORT_XE_HPG_CORE) if(TESTS_XE_HPG_CORE) ADD_ITEM_FOR_CORE_TYPE("FAMILY_NAME" "TESTED" "XE_HPG_CORE" "XeHpgCoreFamily") diff --git a/level_zero/core/source/xe_hp_core/xehp/CMakeLists.txt b/level_zero/core/source/xe_hp_core/xehp/CMakeLists.txt deleted file mode 100644 index 39b767f537..0000000000 --- a/level_zero/core/source/xe_hp_core/xehp/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (C) 2021-2023 Intel Corporation -# -# SPDX-License-Identifier: MIT -# - -if(SUPPORT_XE_HP_SDV) - target_sources(${L0_STATIC_LIB_NAME} PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt - ${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_xehp.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/cmdqueue_xehp.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/kernel_xehp.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/image_xehp.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/sampler_xehp.cpp - ) -endif() diff --git a/level_zero/core/source/xe_hp_core/xehp/cmdlist_xehp.cpp b/level_zero/core/source/xe_hp_core/xehp/cmdlist_xehp.cpp deleted file mode 100644 index f2af438d48..0000000000 --- a/level_zero/core/source/xe_hp_core/xehp/cmdlist_xehp.cpp +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2021-2022 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/xe_hp_core/hw_cmds_base.h" - -#include "level_zero/core/source/xe_hp_core/cmdlist_xe_hp_core.h" - -namespace L0 { -static CommandListPopulateFactory> - populateXEHP; - -static CommandListImmediatePopulateFactory> - populateXEHPImmediate; - -} // namespace L0 diff --git a/level_zero/core/source/xe_hp_core/xehp/cmdqueue_xehp.cpp b/level_zero/core/source/xe_hp_core/xehp/cmdqueue_xehp.cpp deleted file mode 100644 index a11bb5f203..0000000000 --- a/level_zero/core/source/xe_hp_core/xehp/cmdqueue_xehp.cpp +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2021-2022 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/xe_hp_core/hw_cmds.h" - -#include "level_zero/core/source/cmdqueue/cmdqueue_hw.inl" -#include "level_zero/core/source/cmdqueue/cmdqueue_xe_hp_core_and_later.inl" - -#include "cmdqueue_extended.inl" -namespace L0 { -template struct CommandQueueHw; -static CommandQueuePopulateFactory> - populateXEHP; - -} // namespace L0 diff --git a/level_zero/core/source/xe_hp_core/xehp/image_xehp.cpp b/level_zero/core/source/xe_hp_core/xehp/image_xehp.cpp deleted file mode 100644 index 0aa5a867c7..0000000000 --- a/level_zero/core/source/xe_hp_core/xehp/image_xehp.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2021 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "level_zero/core/source/xe_hp_core/image_xe_hp_core.inl" - -namespace L0 { - -template <> -struct ImageProductFamily : public ImageCoreFamily { - using ImageCoreFamily::ImageCoreFamily; - - ze_result_t initialize(Device *device, const ze_image_desc_t *desc) override { - return ImageCoreFamily::initialize(device, desc); - }; -}; - -static ImagePopulateFactory> populateXEHP; - -} // namespace L0 diff --git a/level_zero/core/source/xe_hp_core/xehp/kernel_xehp.cpp b/level_zero/core/source/xe_hp_core/xehp/kernel_xehp.cpp deleted file mode 100644 index f6ab0489bc..0000000000 --- a/level_zero/core/source/xe_hp_core/xehp/kernel_xehp.cpp +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (C) 2021-2022 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/xe_hp_core/hw_cmds_base.h" - -#include "level_zero/core/source/kernel/kernel_hw.h" - -namespace L0 { - -static KernelPopulateFactory> populateXEHP; - -} // namespace L0 diff --git a/level_zero/core/source/xe_hp_core/xehp/sampler_xehp.cpp b/level_zero/core/source/xe_hp_core/xehp/sampler_xehp.cpp deleted file mode 100644 index 0e861c16c9..0000000000 --- a/level_zero/core/source/xe_hp_core/xehp/sampler_xehp.cpp +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2021 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "level_zero/core/source/xe_hp_core/sampler_xe_hp_core.inl" - -namespace L0 { - -template <> -struct SamplerProductFamily : public SamplerCoreFamily { - using SamplerCoreFamily::SamplerCoreFamily; -}; - -static SamplerPopulateFactory> populateXEHP; - -} // namespace L0 diff --git a/opencl/test/unit_test/xe_hp_core/xehp/CMakeLists.txt b/opencl/test/unit_test/xe_hp_core/xehp/CMakeLists.txt deleted file mode 100644 index e3fb072b8d..0000000000 --- a/opencl/test/unit_test/xe_hp_core/xehp/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright (C) 2021-2023 Intel Corporation -# -# SPDX-License-Identifier: MIT -# - -if(TESTS_XE_HP_SDV) - set(IGDRCL_SRCS_tests_xe_hp_core_xehp - ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt - ${CMAKE_CURRENT_SOURCE_DIR}/cache_flush_tests_xehp.inl - ${CMAKE_CURRENT_SOURCE_DIR}/get_device_info_xehp.inl - ${CMAKE_CURRENT_SOURCE_DIR}/gfx_core_helper_tests_xehp.inl - ${CMAKE_CURRENT_SOURCE_DIR}/hw_info_tests_xehp.inl - ${CMAKE_CURRENT_SOURCE_DIR}/memory_manager_tests_xehp.inl - ${CMAKE_CURRENT_SOURCE_DIR}/sampler_tests_xehp.inl - ${CMAKE_CURRENT_SOURCE_DIR}/source_level_debugger_csr_tests_xehp.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_buffer_xe_hp_sdv.inl - ${CMAKE_CURRENT_SOURCE_DIR}/test_command_stream_receiver_xehp.inl - ${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_xehp.inl - ${CMAKE_CURRENT_SOURCE_DIR}/test_product_helper_xehp.inl - ${CMAKE_CURRENT_SOURCE_DIR}/test_image_xe_hp_sdv.inl - ${CMAKE_CURRENT_SOURCE_DIR}/test_local_work_size_xehp.inl - ${CMAKE_CURRENT_SOURCE_DIR}/test_sub_devices_xehp.inl - ${CMAKE_CURRENT_SOURCE_DIR}/test_preamble_xehp.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_platform_caps_xehp.inl - ${CMAKE_CURRENT_SOURCE_DIR}/test_wrapper_xehp.cpp - ) - - target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_xe_hp_core_xehp}) - add_subdirectories() -endif() diff --git a/opencl/test/unit_test/xe_hp_core/xehp/cache_flush_tests_xehp.inl b/opencl/test/unit_test/xe_hp_core/xehp/cache_flush_tests_xehp.inl deleted file mode 100644 index a9897a79d2..0000000000 --- a/opencl/test/unit_test/xe_hp_core/xehp/cache_flush_tests_xehp.inl +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2021-2022 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/test/common/mocks/mock_allocation_properties.h" -#include "shared/test/common/test_macros/test.h" -#include "shared/test/common/utilities/base_object_utils.h" - -#include "opencl/test/unit_test/kernel/cache_flush_xehp_and_later_tests.inl" -#include "opencl/test/unit_test/mocks/mock_command_queue.h" - -using namespace NEO; - -using GivenCacheFlushAfterWalkerEnabledWhenSvmAllocationsSetAsCacheFlushRequiringThenExpectCacheFlushCommandXEHP = GivenCacheFlushAfterWalkerEnabledWhenSvmAllocationsSetAsCacheFlushRequiringThenExpectCacheFlushCommand; -XEHPTEST_F(GivenCacheFlushAfterWalkerEnabledWhenSvmAllocationsSetAsCacheFlushRequiringThenExpectCacheFlushCommandXEHP, I) { - testBodyImpl(); -} - -using GivenCacheFlushAfterWalkerEnabledWhenKernelArgIsSetAsCacheFlushRequiredThenExpectCacheFlushCommandXEHP = GivenCacheFlushAfterWalkerEnabledWhenKernelArgIsSetAsCacheFlushRequiredThenExpectCacheFlushCommand; -XEHPTEST_F(GivenCacheFlushAfterWalkerEnabledWhenKernelArgIsSetAsCacheFlushRequiredThenExpectCacheFlushCommandXEHP, I) { - testBodyImpl(); -} - -using GivenCacheFlushAfterWalkerEnabledWhenProgramGlobalSurfacePresentThenExpectCacheFlushCommandXEHP = GivenCacheFlushAfterWalkerEnabledWhenProgramGlobalSurfacePresentThenExpectCacheFlushCommand; -XEHPTEST_F(GivenCacheFlushAfterWalkerEnabledWhenProgramGlobalSurfacePresentThenExpectCacheFlushCommandXEHP, I) { - testBodyImpl(); -} - -using GivenCacheFlushAfterWalkerEnabledWhenProgramGlobalSurfacePresentAndPostSyncRequiredThenExpectProperCacheFlushCommandXEHP = GivenCacheFlushAfterWalkerEnabledWhenProgramGlobalSurfacePresentAndPostSyncRequiredThenExpectProperCacheFlushCommand; -XEHPTEST_F(GivenCacheFlushAfterWalkerEnabledWhenProgramGlobalSurfacePresentAndPostSyncRequiredThenExpectProperCacheFlushCommandXEHP, I) { - testBodyImpl(); -} - -using GivenCacheFlushAfterWalkerEnabledWhenAllocationRequiresCacheFlushThenFlushCommandPresentAfterWalkerXEHP = GivenCacheFlushAfterWalkerEnabledWhenAllocationRequiresCacheFlushThenFlushCommandPresentAfterWalker; -XEHPTEST_F(GivenCacheFlushAfterWalkerEnabledWhenAllocationRequiresCacheFlushThenFlushCommandPresentAfterWalkerXEHP, I) { - testBodyImpl(); -} - -using GivenCacheFlushAfterWalkerDisabledWhenAllocationRequiresCacheFlushThenFlushCommandNotPresentAfterWalkerXEHP = GivenCacheFlushAfterWalkerDisabledWhenAllocationRequiresCacheFlushThenFlushCommandNotPresentAfterWalker; -XEHPTEST_F(GivenCacheFlushAfterWalkerDisabledWhenAllocationRequiresCacheFlushThenFlushCommandNotPresentAfterWalkerXEHP, I) { - testBodyImpl(); -} - -using GivenCacheFlushAfterWalkerAndTimestampPacketsEnabledWhenAllocationRequiresCacheFlushThenFlushCommandPresentAfterWalkerXEHP = GivenCacheFlushAfterWalkerAndTimestampPacketsEnabledWhenAllocationRequiresCacheFlushThenFlushCommandPresentAfterWalker; -XEHPTEST_F(GivenCacheFlushAfterWalkerAndTimestampPacketsEnabledWhenAllocationRequiresCacheFlushThenFlushCommandPresentAfterWalkerXEHP, I) { - testBodyImpl(); -} - -using GivenCacheFlushAfterWalkerEnabledWhenSvmAllocationsSetAsCacheFlushRequiringThenExpectCorrectCommandSizeXEHP = GivenCacheFlushAfterWalkerEnabledWhenSvmAllocationsSetAsCacheFlushRequiringThenExpectCorrectCommandSize; -XEHPTEST_F(GivenCacheFlushAfterWalkerEnabledWhenSvmAllocationsSetAsCacheFlushRequiringThenExpectCorrectCommandSizeXEHP, I) { - testBodyImpl(); -} -using GivenCacheFlushAfterWalkerEnabledWhenMoreThan126AllocationRangesRequiresCacheFlushThenAtLeatsTwoFlushCommandPresentAfterWalkerXEHP = GivenCacheFlushAfterWalkerEnabledWhenMoreThan126AllocationRangesRequiresCacheFlushThenAtLeatsTwoFlushCommandPresentAfterWalker; -XEHPTEST_F(GivenCacheFlushAfterWalkerEnabledWhenMoreThan126AllocationRangesRequiresCacheFlushThenAtLeatsTwoFlushCommandPresentAfterWalkerXEHP, I) { - testBodyImpl(); -} -using GivenCacheFlushAfterWalkerEnabledWhen126AllocationRangesRequiresCacheFlushThenExpectOneFlushXEHP = GivenCacheFlushAfterWalkerEnabledWhen126AllocationRangesRequiresCacheFlushThenExpectOneFlush; -XEHPTEST_F(GivenCacheFlushAfterWalkerEnabledWhen126AllocationRangesRequiresCacheFlushThenExpectOneFlushXEHP, I) { - testBodyImpl(); -} -using GivenCacheFlushAfterWalkerAndTimestampPacketsEnabledWhenMoreThan126AllocationRangesRequiresCacheFlushThenExpectFlushWithOutPostSyncAndThenWithPostSyncXEHP = GivenCacheFlushAfterWalkerAndTimestampPacketsEnabledWhenMoreThan126AllocationRangesRequiresCacheFlushThenExpectFlushWithOutPostSyncAndThenWithPostSync; -XEHPTEST_F(GivenCacheFlushAfterWalkerAndTimestampPacketsEnabledWhenMoreThan126AllocationRangesRequiresCacheFlushThenExpectFlushWithOutPostSyncAndThenWithPostSyncXEHP, I) { - testBodyImpl(); -} - -using CommandQueueHwCacheFlushTest = ::testing::Test; -XEHPTEST_F(CommandQueueHwCacheFlushTest, givenHwCommandQueueForSpecificTileThenCacheFlushAfterWalkerIsNeeded) { - UltClDeviceFactory clDeviceFactory{1, 2}; - cl_device_id devices[] = {clDeviceFactory.subDevices[0], clDeviceFactory.subDevices[1]}; - MockContext context{ClDeviceVector{devices, 2}}; - - { - MockCommandQueueHw commandQueue{&context, clDeviceFactory.rootDevices[0], nullptr}; - EXPECT_FALSE(commandQueue.getRequiresCacheFlushAfterWalker()); - } - { - MockCommandQueueHw commandQueue{&context, clDeviceFactory.subDevices[0], nullptr}; - EXPECT_TRUE(commandQueue.getRequiresCacheFlushAfterWalker()); - } -} diff --git a/opencl/test/unit_test/xe_hp_core/xehp/get_device_info_xehp.inl b/opencl/test/unit_test/xe_hp_core/xehp/get_device_info_xehp.inl deleted file mode 100644 index a6dac08e77..0000000000 --- a/opencl/test/unit_test/xe_hp_core/xehp/get_device_info_xehp.inl +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2021-2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/os_interface/product_helper.h" -#include "shared/test/common/helpers/debug_manager_state_restore.h" -#include "shared/test/common/test_macros/test.h" - -#include "opencl/test/unit_test/fixtures/device_info_fixture.h" - -using namespace NEO; - -HWTEST_EXCLUDE_PRODUCT(GetDeviceInfoMemCapabilitiesTest, GivenValidParametersWhenGetDeviceInfoIsCalledForXE_HP_COREThenClSuccessIsReturned, IGFX_XE_HP_SDV); - -XEHPTEST_F(GetDeviceInfoMemCapabilitiesTest, GivenValidParametersWhenGetDeviceInfoIsCalledForXEHPThenClSuccessIsReturned) { - std::vector params = { - {CL_DEVICE_DEVICE_MEM_CAPABILITIES_INTEL, - (CL_UNIFIED_SHARED_MEMORY_ACCESS_INTEL | CL_UNIFIED_SHARED_MEMORY_ATOMIC_ACCESS_INTEL)}, - {CL_DEVICE_SINGLE_DEVICE_SHARED_MEM_CAPABILITIES_INTEL, - (CL_UNIFIED_SHARED_MEMORY_ACCESS_INTEL | CL_UNIFIED_SHARED_MEMORY_ATOMIC_ACCESS_INTEL)}, - {CL_DEVICE_CROSS_DEVICE_SHARED_MEM_CAPABILITIES_INTEL, - (CL_UNIFIED_SHARED_MEMORY_ACCESS_INTEL | CL_UNIFIED_SHARED_MEMORY_ATOMIC_ACCESS_INTEL)}, - {CL_DEVICE_SHARED_SYSTEM_MEM_CAPABILITIES_INTEL, 0}}; - - check(params); -} - -XEHPTEST_F(GetDeviceInfoMemCapabilitiesTest, GivenA0ThenUsmHostMemSupportIsEnabledByDefault) { - std::vector params = {{CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL, CL_UNIFIED_SHARED_MEMORY_ACCESS_INTEL}}; - - check(params); -} - -XEHPTEST_F(GetDeviceInfoMemCapabilitiesTest, GivenDebugVariableIsEnabledThenUsmHostMemSupportIsEnabled) { - DebugManagerStateRestore dbgRestorer; - DebugManager.flags.EnableHostUsmSupport.set(1); - std::vector params = {{CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL, CL_UNIFIED_SHARED_MEMORY_ACCESS_INTEL}}; - - check(params); -} - -XEHPTEST_F(GetDeviceInfoMemCapabilitiesTest, GivenA0AndDebugVariableIsDisabledThenUsmHostMemSupportIsDisabled) { - VariableBackup backupHwInfo(defaultHwInfo.get()); - const auto &productHelper = *ProductHelper::get(defaultHwInfo->platform.eProductFamily); - defaultHwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, *defaultHwInfo); - DebugManagerStateRestore dbgRestorer; - DebugManager.flags.EnableHostUsmSupport.set(0); - std::vector params = {{CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL, 0}}; - std::vector enabledParams = {{CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL, CL_UNIFIED_SHARED_MEMORY_ACCESS_INTEL}}; - - check(params); - - DebugManager.flags.ForceLocalMemoryAccessMode.set(1); - check(params); - - DebugManager.flags.EnableHostUsmSupport.set(1); - check(enabledParams); - - DebugManager.flags.EnableHostUsmSupport.set(-1); - check(params); -} - -XEHPTEST_F(GetDeviceInfoMemCapabilitiesTest, GivenB0ThenUsmHostMemSupportIsSetCorrectly) { - const auto &productHelper = *ProductHelper::get(defaultHwInfo->platform.eProductFamily); - VariableBackup backupHwInfo(defaultHwInfo.get()); - defaultHwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, *defaultHwInfo); - std::vector params = {{CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL, CL_UNIFIED_SHARED_MEMORY_ACCESS_INTEL}}; - std::vector disabledParameters = {{CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL, 0u}}; - - check(params); - - { - DebugManagerStateRestore dbgRestorer; - DebugManager.flags.EnableHostUsmSupport.set(0); - check(disabledParameters); - } - - { - DebugManagerStateRestore dbgRestorer; - DebugManager.flags.EnableHostUsmSupport.set(1); - check(params); - } -} diff --git a/opencl/test/unit_test/xe_hp_core/xehp/gfx_core_helper_tests_xehp.inl b/opencl/test/unit_test/xe_hp_core/xehp/gfx_core_helper_tests_xehp.inl deleted file mode 100644 index 107012c43b..0000000000 --- a/opencl/test/unit_test/xe_hp_core/xehp/gfx_core_helper_tests_xehp.inl +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (C) 2021-2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/test/common/helpers/gfx_core_helper_tests.h" - -using GfxCoreHelperTestsXeHP = GfxCoreHelperTest; - -XEHPTEST_F(GfxCoreHelperTestsXeHP, givenXEHPWhenIsBankOverrideRequiredIsCalledThenCorrectValueIsReturned) { - DebugManagerStateRestore restore; - auto &gfxCoreHelper = getHelper(); - auto &productHelper = getHelper(); - - auto hwInfo = *defaultHwInfo; - hwInfo.gtSystemInfo.MultiTileArchInfo.IsValid = true; - - { - hwInfo.gtSystemInfo.MultiTileArchInfo.TileCount = 4; - hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hwInfo); - EXPECT_TRUE(gfxCoreHelper.isBankOverrideRequired(hwInfo, productHelper)); - } - { - hwInfo.gtSystemInfo.MultiTileArchInfo.TileCount = 4; - hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hwInfo); - EXPECT_FALSE(gfxCoreHelper.isBankOverrideRequired(hwInfo, productHelper)); - } - { - hwInfo.gtSystemInfo.MultiTileArchInfo.TileCount = 2; - hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hwInfo); - EXPECT_FALSE(gfxCoreHelper.isBankOverrideRequired(hwInfo, productHelper)); - } - { - DebugManager.flags.ForceMemoryBankIndexOverride.set(1); - hwInfo.gtSystemInfo.MultiTileArchInfo.TileCount = 1; - hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hwInfo); - EXPECT_TRUE(gfxCoreHelper.isBankOverrideRequired(hwInfo, productHelper)); - } - { - DebugManager.flags.ForceMemoryBankIndexOverride.set(0); - hwInfo.gtSystemInfo.MultiTileArchInfo.TileCount = 4; - hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hwInfo); - EXPECT_FALSE(gfxCoreHelper.isBankOverrideRequired(hwInfo, productHelper)); - } -} - -XEHPTEST_F(GfxCoreHelperTestsXeHP, givenRcsDisabledWhenGetGpgpuEnginesCalledThenDontSetRcs) { - HardwareInfo hwInfo = *defaultHwInfo; - hwInfo.featureTable.flags.ftrCCSNode = true; - hwInfo.featureTable.ftrBcsInfo = 1; - hwInfo.featureTable.flags.ftrRcsNode = false; - hwInfo.capabilityTable.blitterOperationsSupported = true; - hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCS; - hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 4; - - auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - - EXPECT_EQ(8u, device->allEngines.size()); - auto &engines = GfxCoreHelperHw::get().getGpgpuEngineInstances(hwInfo); - EXPECT_EQ(8u, engines.size()); - - EXPECT_EQ(aub_stream::ENGINE_CCS, engines[0].first); - EXPECT_EQ(aub_stream::ENGINE_CCS1, engines[1].first); - EXPECT_EQ(aub_stream::ENGINE_CCS2, engines[2].first); - EXPECT_EQ(aub_stream::ENGINE_CCS3, engines[3].first); - EXPECT_EQ(hwInfo.capabilityTable.defaultEngineType, engines[4].first); // low priority - EXPECT_EQ(hwInfo.capabilityTable.defaultEngineType, engines[5].first); // internal - EXPECT_EQ(aub_stream::ENGINE_BCS, engines[6].first); - EXPECT_EQ(aub_stream::ENGINE_BCS, engines[7].first); -} - -XEHPTEST_F(GfxCoreHelperTestsXeHP, givenRcsDisabledButDebugVariableSetWhenGetGpgpuEnginesCalledThenSetRcs) { - HardwareInfo hwInfo = *defaultHwInfo; - hwInfo.featureTable.flags.ftrCCSNode = true; - hwInfo.featureTable.ftrBcsInfo = 1; - hwInfo.featureTable.flags.ftrRcsNode = false; - hwInfo.capabilityTable.blitterOperationsSupported = true; - hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCS; - hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 4; - - DebugManagerStateRestore restore; - DebugManager.flags.NodeOrdinal.set(static_cast(aub_stream::EngineType::ENGINE_RCS)); - - auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - - EXPECT_EQ(9u, device->allEngines.size()); - auto &engines = GfxCoreHelperHw::get().getGpgpuEngineInstances(hwInfo); - EXPECT_EQ(9u, engines.size()); - - EXPECT_EQ(aub_stream::ENGINE_CCS, engines[0].first); - EXPECT_EQ(aub_stream::ENGINE_CCS1, engines[1].first); - EXPECT_EQ(aub_stream::ENGINE_CCS2, engines[2].first); - EXPECT_EQ(aub_stream::ENGINE_CCS3, engines[3].first); - EXPECT_EQ(aub_stream::ENGINE_RCS, engines[4].first); - EXPECT_EQ(aub_stream::ENGINE_RCS, engines[5].first); // low priority - EXPECT_EQ(aub_stream::ENGINE_RCS, engines[6].first); // internal - EXPECT_EQ(aub_stream::ENGINE_BCS, engines[7].first); - EXPECT_EQ(aub_stream::ENGINE_BCS, engines[8].first); -} - -XEHPTEST_F(GfxCoreHelperTestsXeHP, GivenVariousValuesWhenComputeSlmSizeIsCalledThenCorrectValueIsReturned) { - auto &hwInfo = pDevice->getHardwareInfo(); - - for (auto &testInput : computeSlmValuesXeHPAndLaterTestsInput) { - EXPECT_EQ(testInput.expected, GfxCoreHelperHw::get().computeSlmValues(hwInfo, testInput.slmSize)); - } -} diff --git a/opencl/test/unit_test/xe_hp_core/xehp/hw_info_tests_xehp.inl b/opencl/test/unit_test/xe_hp_core/xehp/hw_info_tests_xehp.inl deleted file mode 100644 index 81ef6f5f67..0000000000 --- a/opencl/test/unit_test/xe_hp_core/xehp/hw_info_tests_xehp.inl +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2021-2022 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/helpers/hw_info.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/gtest_helpers.h" -#include "shared/test/common/test_macros/test.h" - -using namespace NEO; - -using XeHPHwInfoTest = ::testing::Test; - -XEHPTEST_F(XeHPHwInfoTest, whenSetupHardwareInfoWithSetupFeatureTableFlagTrueOrFalseIsCalledThenFeatureTableHasCorrectValues) { - HardwareInfo hwInfo = *defaultHwInfo; - FeatureTable &featureTable = hwInfo.featureTable; - GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; - - EXPECT_FALSE(featureTable.flags.ftrLocalMemory); - EXPECT_FALSE(featureTable.flags.ftrFlatPhysCCS); - EXPECT_FALSE(featureTable.flags.ftrLinearCCS); - EXPECT_FALSE(featureTable.flags.ftrE2ECompression); - EXPECT_FALSE(featureTable.flags.ftrCCSNode); - EXPECT_FALSE(featureTable.flags.ftrCCSRing); - EXPECT_FALSE(featureTable.flags.ftrMultiTileArch); - EXPECT_FALSE(featureTable.flags.ftrLinearCCS); - EXPECT_FALSE(gtSystemInfo.IsL3HashModeEnabled); - EXPECT_FALSE(gtSystemInfo.IsDynamicallyPopulated); - EXPECT_EQ(8u, gtSystemInfo.CsrSizeInMb); - - XehpSdvHwConfig::setupHardwareInfo(&hwInfo, false); - EXPECT_FALSE(featureTable.flags.ftrLocalMemory); - EXPECT_FALSE(featureTable.flags.ftrFlatPhysCCS); - EXPECT_FALSE(featureTable.flags.ftrLinearCCS); - EXPECT_FALSE(featureTable.flags.ftrE2ECompression); - EXPECT_FALSE(featureTable.flags.ftrCCSNode); - EXPECT_FALSE(featureTable.flags.ftrCCSRing); - EXPECT_FALSE(featureTable.flags.ftrMultiTileArch); - EXPECT_FALSE(featureTable.flags.ftrLinearCCS); - EXPECT_FALSE(gtSystemInfo.IsL3HashModeEnabled); - EXPECT_FALSE(gtSystemInfo.IsDynamicallyPopulated); - EXPECT_EQ(8u, gtSystemInfo.CsrSizeInMb); - - XehpSdvHwConfig::setupHardwareInfo(&hwInfo, true); - EXPECT_TRUE(featureTable.flags.ftrLocalMemory); - EXPECT_TRUE(featureTable.flags.ftrFlatPhysCCS); - EXPECT_TRUE(featureTable.flags.ftrLinearCCS); - EXPECT_TRUE(featureTable.flags.ftrE2ECompression); - EXPECT_TRUE(featureTable.flags.ftrCCSNode); - EXPECT_TRUE(featureTable.flags.ftrCCSRing); - EXPECT_TRUE(featureTable.flags.ftrMultiTileArch); - EXPECT_TRUE(featureTable.flags.ftrLinearCCS); - EXPECT_FALSE(gtSystemInfo.IsL3HashModeEnabled); - EXPECT_FALSE(gtSystemInfo.IsDynamicallyPopulated); - EXPECT_EQ(8u, gtSystemInfo.CsrSizeInMb); -} - -XEHPTEST_F(XeHPHwInfoTest, givenAlreadyInitializedHwInfoWhenSetupCalledThenDontOverride) { - HardwareInfo hwInfo = *defaultHwInfo; - - hwInfo.gtSystemInfo.SliceCount = 0; - - XehpSdvHwConfig::setupHardwareInfo(&hwInfo, false); - - EXPECT_NE(0u, hwInfo.gtSystemInfo.SliceCount); - - auto expectedValue = ++hwInfo.gtSystemInfo.SliceCount; - - XehpSdvHwConfig::setupHardwareInfo(&hwInfo, false); - - EXPECT_EQ(expectedValue, hwInfo.gtSystemInfo.SliceCount); -} - -XEHPTEST_F(XeHPHwInfoTest, givenXeHpConfigWhenSetupHardwareInfoBaseThenGtSystemInfoIsCorrect) { - HardwareInfo hwInfo = *defaultHwInfo; - GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; - XE_HP_SDV::setupHardwareInfoBase(&hwInfo, false); - - EXPECT_EQ(336u, gtSystemInfo.TotalVsThreads); - EXPECT_EQ(336u, gtSystemInfo.TotalHsThreads); - EXPECT_EQ(336u, gtSystemInfo.TotalDsThreads); - EXPECT_EQ(336u, gtSystemInfo.TotalGsThreads); - EXPECT_EQ(64u, gtSystemInfo.TotalPsThreadsWindowerRange); - EXPECT_EQ(8u, gtSystemInfo.CsrSizeInMb); - EXPECT_FALSE(gtSystemInfo.IsL3HashModeEnabled); - EXPECT_FALSE(gtSystemInfo.IsDynamicallyPopulated); -} diff --git a/opencl/test/unit_test/xe_hp_core/xehp/linux/CMakeLists.txt b/opencl/test/unit_test/xe_hp_core/xehp/linux/CMakeLists.txt deleted file mode 100644 index af734405ec..0000000000 --- a/opencl/test/unit_test/xe_hp_core/xehp/linux/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (C) 2021-2022 Intel Corporation -# -# SPDX-License-Identifier: MIT -# - -if(UNIX) - add_subdirectories() -endif() diff --git a/opencl/test/unit_test/xe_hp_core/xehp/linux/dll/CMakeLists.txt b/opencl/test/unit_test/xe_hp_core/xehp/linux/dll/CMakeLists.txt deleted file mode 100644 index ae0a03f2a3..0000000000 --- a/opencl/test/unit_test/xe_hp_core/xehp/linux/dll/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -# -# Copyright (C) 2021 Intel Corporation -# -# SPDX-License-Identifier: MIT -# - -set(IGDRCL_SRCS_linux_dll_tests_xe_hp_core_xehp - ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt - ${CMAKE_CURRENT_SOURCE_DIR}/device_id_tests_xehp.cpp -) -target_sources(igdrcl_linux_dll_tests PRIVATE ${IGDRCL_SRCS_linux_dll_tests_xe_hp_core_xehp}) diff --git a/opencl/test/unit_test/xe_hp_core/xehp/linux/dll/device_id_tests_xehp.cpp b/opencl/test/unit_test/xe_hp_core/xehp/linux/dll/device_id_tests_xehp.cpp deleted file mode 100644 index 155ad289f9..0000000000 --- a/opencl/test/unit_test/xe_hp_core/xehp/linux/dll/device_id_tests_xehp.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2021-2022 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/test/common/fixtures/linux/device_id_fixture.h" - -using namespace NEO; - -TEST_F(DeviceIdTests, GivenXeHpSdvSupportedDeviceIdThenConfigIsCorrect) { - std::array expectedDescriptors = {{{0x0201, &XehpSdvHwConfig::hwInfo, &XehpSdvHwConfig::setupHardwareInfo}, - {0x0202, &XehpSdvHwConfig::hwInfo, &XehpSdvHwConfig::setupHardwareInfo}, - {0x0203, &XehpSdvHwConfig::hwInfo, &XehpSdvHwConfig::setupHardwareInfo}, - {0x0204, &XehpSdvHwConfig::hwInfo, &XehpSdvHwConfig::setupHardwareInfo}, - {0x0205, &XehpSdvHwConfig::hwInfo, &XehpSdvHwConfig::setupHardwareInfo}, - {0x0206, &XehpSdvHwConfig::hwInfo, &XehpSdvHwConfig::setupHardwareInfo}, - {0x0207, &XehpSdvHwConfig::hwInfo, &XehpSdvHwConfig::setupHardwareInfo}, - {0x0208, &XehpSdvHwConfig::hwInfo, &XehpSdvHwConfig::setupHardwareInfo}, - {0x0209, &XehpSdvHwConfig::hwInfo, &XehpSdvHwConfig::setupHardwareInfo}, - {0x020A, &XehpSdvHwConfig::hwInfo, &XehpSdvHwConfig::setupHardwareInfo}, - {0x020B, &XehpSdvHwConfig::hwInfo, &XehpSdvHwConfig::setupHardwareInfo}, - {0x020C, &XehpSdvHwConfig::hwInfo, &XehpSdvHwConfig::setupHardwareInfo}, - {0x020D, &XehpSdvHwConfig::hwInfo, &XehpSdvHwConfig::setupHardwareInfo}, - {0x020E, &XehpSdvHwConfig::hwInfo, &XehpSdvHwConfig::setupHardwareInfo}, - {0x020F, &XehpSdvHwConfig::hwInfo, &XehpSdvHwConfig::setupHardwareInfo}, - {0x0210, &XehpSdvHwConfig::hwInfo, &XehpSdvHwConfig::setupHardwareInfo}}}; - - testImpl(expectedDescriptors); -} diff --git a/opencl/test/unit_test/xe_hp_core/xehp/memory_manager_tests_xehp.inl b/opencl/test/unit_test/xe_hp_core/xehp/memory_manager_tests_xehp.inl deleted file mode 100644 index b846cde330..0000000000 --- a/opencl/test/unit_test/xe_hp_core/xehp/memory_manager_tests_xehp.inl +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2021-2022 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/test/common/mocks/mock_execution_environment.h" -#include "shared/test/common/mocks/mock_graphics_allocation.h" -#include "shared/test/common/mocks/mock_memory_manager.h" -#include "shared/test/common/test_macros/test.h" - -using namespace NEO; - -using MemoryManagerTestsXeHP = ::testing::Test; -XEHPTEST_F(MemoryManagerTestsXeHP, givenEnabledLocalMemoryWhenLinearStreamIsAllocatedInPreferredPoolThenLocalMemoryPoolIsUsed) { - MockExecutionEnvironment executionEnvironment(defaultHwInfo.get()); - MockMemoryManager memoryManager(false, true, executionEnvironment); - - auto allocation = memoryManager.allocateGraphicsMemoryInPreferredPool({mockRootDeviceIndex, MemoryConstants::pageSize, AllocationType::LINEAR_STREAM, mockDeviceBitfield}, nullptr); - EXPECT_EQ(MemoryPool::LocalMemory, allocation->getMemoryPool()); - EXPECT_TRUE(memoryManager.allocationInDevicePoolCreated); - - memoryManager.freeGraphicsMemory(allocation); -} diff --git a/opencl/test/unit_test/xe_hp_core/xehp/sampler_tests_xehp.inl b/opencl/test/unit_test/xe_hp_core/xehp/sampler_tests_xehp.inl deleted file mode 100644 index 0b5a30262b..0000000000 --- a/opencl/test/unit_test/xe_hp_core/xehp/sampler_tests_xehp.inl +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2021-2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/debug_settings/debug_settings_manager.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/test/common/helpers/debug_manager_state_restore.h" -#include "shared/test/common/test_macros/test.h" - -#include "opencl/test/unit_test/fixtures/cl_device_fixture.h" - -#include - -using namespace NEO; - -using XeHPSamplerTest = Test; - -XEHPTEST_F(XeHPSamplerTest, givenXeHPSamplerWhenUsingDefaultFilteringAndAppendSamplerStateParamsThenDisableLowQualityFilter) { - using SAMPLER_STATE = typename FamilyType::SAMPLER_STATE; - - EXPECT_FALSE(DebugManager.flags.ForceSamplerLowFilteringPrecision.get()); - - auto state = FamilyType::cmdInitSamplerState; - EXPECT_EQ(SAMPLER_STATE::LOW_QUALITY_FILTER_DISABLE, state.getLowQualityFilter()); - - auto &helper = getHelper(); - helper.adjustSamplerState(&state, *defaultHwInfo); - EXPECT_EQ(SAMPLER_STATE::LOW_QUALITY_FILTER_DISABLE, state.getLowQualityFilter()); -} - -XEHPTEST_F(XeHPSamplerTest, givenXeHPSamplerWhenForcingLowQualityFilteringAndAppendSamplerStateParamsThenEnableLowQualityFilter) { - DebugManagerStateRestore dbgRestore; - DebugManager.flags.ForceSamplerLowFilteringPrecision.set(true); - - using SAMPLER_STATE = typename FamilyType::SAMPLER_STATE; - - auto state = FamilyType::cmdInitSamplerState; - EXPECT_EQ(SAMPLER_STATE::LOW_QUALITY_FILTER_DISABLE, state.getLowQualityFilter()); - - auto &helper = getHelper(); - helper.adjustSamplerState(&state, *defaultHwInfo); - EXPECT_EQ(SAMPLER_STATE::LOW_QUALITY_FILTER_ENABLE, state.getLowQualityFilter()); -} diff --git a/opencl/test/unit_test/xe_hp_core/xehp/source_level_debugger_csr_tests_xehp.cpp b/opencl/test/unit_test/xe_hp_core/xehp/source_level_debugger_csr_tests_xehp.cpp deleted file mode 100644 index beef041652..0000000000 --- a/opencl/test/unit_test/xe_hp_core/xehp/source_level_debugger_csr_tests_xehp.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (C) 2021-2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/source_level_debugger/source_level_debugger.h" -#include "shared/source/xe_hp_core/hw_cmds.h" -#include "shared/test/common/cmd_parse/hw_parse.h" -#include "shared/test/common/helpers/dispatch_flags_helper.h" -#include "shared/test/common/mocks/mock_device.h" -#include "shared/test/common/mocks/mock_graphics_allocation.h" -#include "shared/test/common/test_macros/header/per_product_test_definitions.h" -#include "shared/test/common/test_macros/test.h" - -#include "opencl/source/command_queue/command_queue_hw.h" -#include "opencl/test/unit_test/mocks/mock_platform.h" -#include "opencl/test/unit_test/source_level_debugger/source_level_debugger_csr_tests.h" - -#include - -using CommandStreamReceiverWithActiveDebuggerXehpTest = CommandStreamReceiverWithActiveDebuggerTest; - -XEHPTEST_F(CommandStreamReceiverWithActiveDebuggerXehpTest, GivenASteppingAndActiveDebuggerAndWhenFlushTaskIsCalledThenAlwaysProgramStateBaseAddressAndGlobalSip) { - using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM; - using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; - using MI_BATCH_BUFFER_END = typename FamilyType::MI_BATCH_BUFFER_END; - using MI_NOOP = typename FamilyType::MI_NOOP; - - hwInfo = platform()->peekExecutionEnvironment()->rootDeviceEnvironments[0]->getMutableHardwareInfo(); - const auto &productHelper = *ProductHelper::get(hwInfo->platform.eProductFamily); - hwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(REVID::REVISION_A0, *hwInfo); - - auto mockCsr = createCSR(); - mockCsr->overrideDispatchPolicy(DispatchMode::ImmediateDispatch); - - CommandQueueHw commandQueue(nullptr, device.get(), 0, false); - auto &commandStream = commandQueue.getCS(4096u); - auto &csrStream = mockCsr->getCS(0); - - DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags(); - - void *buffer = alignedMalloc(MemoryConstants::pageSize, MemoryConstants::pageSize64k); - - std::unique_ptr allocation(new MockGraphicsAllocation(buffer, MemoryConstants::pageSize)); - std::unique_ptr heap(new IndirectHeap(allocation.get())); - - auto &neoDevice = device->getDevice(); - - mockCsr->flushTask(commandStream, - 0, - heap.get(), - heap.get(), - heap.get(), - 0, - dispatchFlags, - neoDevice); - - mockCsr->flushBatchedSubmissions(); - - auto noops = reinterpret_cast(commandStream.getSpace(8 * sizeof(MI_NOOP))); - - for (int i = 0; i < 8; i++) { - noops[i] = FamilyType::cmdInitNoop; - } - - mockCsr->flushTask(commandStream, - 0, - heap.get(), - heap.get(), - heap.get(), - 0, - dispatchFlags, - neoDevice); - - auto sipAllocation = SipKernel::getSipKernel(neoDevice).getSipAllocation(); - - HardwareParse hwParser; - hwParser.parseCommands(csrStream); - hwParser.parseCommands(commandStream); - - auto itorStateBaseAddr = find(hwParser.cmdList.begin(), hwParser.cmdList.end()); - auto itorBbEnd = find(hwParser.cmdList.begin(), hwParser.cmdList.end()); - auto itorStateBaseAddr2 = find(std::next(itorStateBaseAddr), hwParser.cmdList.end()); - - ASSERT_NE(hwParser.cmdList.end(), itorStateBaseAddr); - ASSERT_NE(hwParser.cmdList.end(), itorStateBaseAddr2); - - auto itorGlobalSip1 = findMmio(itorStateBaseAddr, itorBbEnd, GlobalSipRegister::registerOffset); - auto itorGlobalSip2 = findMmio(std::next(itorGlobalSip1), itorBbEnd, GlobalSipRegister::registerOffset); - auto itorGlobalSip3 = findMmio(itorBbEnd, hwParser.cmdList.end(), GlobalSipRegister::registerOffset); - auto itorGlobalSip4 = findMmio(std::next(itorGlobalSip3), hwParser.cmdList.end(), GlobalSipRegister::registerOffset); - - ASSERT_NE(hwParser.cmdList.end(), itorGlobalSip1); - ASSERT_NE(hwParser.cmdList.end(), itorGlobalSip2); - ASSERT_NE(hwParser.cmdList.end(), itorGlobalSip3); - ASSERT_NE(hwParser.cmdList.end(), itorGlobalSip4); - - EXPECT_NE(itorGlobalSip1, itorGlobalSip2); - - auto expectedSipPosition = --itorBbEnd; - EXPECT_EQ(expectedSipPosition, itorGlobalSip2); - - auto itorBbEnd2 = find(itorGlobalSip3, hwParser.cmdList.end()); - - expectedSipPosition = --itorBbEnd2; - EXPECT_EQ(expectedSipPosition, itorGlobalSip4); - - MI_LOAD_REGISTER_IMM *globalSip = genCmdCast(*itorGlobalSip1); - - auto sipAddress = globalSip->getDataDword(); - EXPECT_EQ(sipAllocation->getGpuAddressToPatch(), sipAddress & 0xfffffff8); - - globalSip = genCmdCast(*itorGlobalSip2); - auto sipAddress2 = globalSip->getDataDword(); - EXPECT_EQ(0u, sipAddress2); - - globalSip = genCmdCast(*itorGlobalSip3); - - sipAddress = globalSip->getDataDword(); - EXPECT_EQ(sipAllocation->getGpuAddressToPatch(), sipAddress & 0xfffffff8); - - globalSip = genCmdCast(*itorGlobalSip4); - sipAddress2 = globalSip->getDataDword(); - EXPECT_EQ(0u, sipAddress2); - - alignedFree(buffer); -} diff --git a/opencl/test/unit_test/xe_hp_core/xehp/test_buffer_xe_hp_sdv.inl b/opencl/test/unit_test/xe_hp_core/xehp/test_buffer_xe_hp_sdv.inl deleted file mode 100644 index a20fa72124..0000000000 --- a/opencl/test/unit_test/xe_hp_core/xehp/test_buffer_xe_hp_sdv.inl +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Copyright (C) 2022 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/command_container/implicit_scaling.h" -#include "shared/test/common/helpers/debug_manager_state_restore.h" -#include "shared/test/common/mocks/mock_device.h" -#include "shared/test/common/test_macros/test.h" - -#include "opencl/source/cl_device/cl_device.h" -#include "opencl/source/mem_obj/buffer.h" -#include "opencl/test/unit_test/mocks/mock_context.h" -#include "opencl/test/unit_test/mocks/mock_platform.h" -using XeHpSdvBufferTests = ::testing::Test; - -XEHPTEST_F(XeHpSdvBufferTests, givenContextTypeDefaultWhenBufferIsWritableAndOnlyOneTileIsAvailableThenRemainFlagsToTrue) { - DebugManagerStateRestore restorer; - DebugManager.flags.CreateMultipleSubDevices.set(1); - initPlatform(); - EXPECT_EQ(0u, platform()->getClDevice(0)->getNumGenericSubDevices()); - using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; - MockContext context(platform()->getClDevice(0)); - context.contextType = ContextType::CONTEXT_TYPE_DEFAULT; - - size_t size = 0x1000; - auto retVal = CL_SUCCESS; - auto buffer = std::unique_ptr( - Buffer::create( - &context, - CL_MEM_READ_WRITE, - size, - nullptr, - retVal)); - EXPECT_EQ(CL_SUCCESS, retVal); - - RENDER_SURFACE_STATE surfaceState = FamilyType::cmdInitRenderSurfaceState; - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuPartialWrites()); - - surfaceState.setDisableSupportForMultiGpuAtomics(false); - surfaceState.setDisableSupportForMultiGpuPartialWrites(false); - buffer->setArgStateful(&surfaceState, false, false, false, false, context.getDevice(0)->getDevice(), false, false); - - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuPartialWrites()); -} - -XEHPTEST_F(XeHpSdvBufferTests, givenContextTypeDefaultWhenBufferIsWritableThenFlipPartialFlagsToFalse) { - DebugManagerStateRestore restorer; - DebugManager.flags.CreateMultipleSubDevices.set(4); - initPlatform(); - - using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; - MockContext context(platform()->getClDevice(0)); - context.contextType = ContextType::CONTEXT_TYPE_DEFAULT; - - size_t size = 0x1000; - auto retVal = CL_SUCCESS; - auto buffer = std::unique_ptr( - Buffer::create( - &context, - CL_MEM_READ_WRITE, - size, - nullptr, - retVal)); - EXPECT_EQ(CL_SUCCESS, retVal); - - RENDER_SURFACE_STATE surfaceState = FamilyType::cmdInitRenderSurfaceState; - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuPartialWrites()); - - buffer->setArgStateful(&surfaceState, false, false, false, false, context.getDevice(0)->getDevice(), true, true); - - EXPECT_FALSE(surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_FALSE(surfaceState.getDisableSupportForMultiGpuPartialWrites()); -} - -XEHPTEST_F(XeHpSdvBufferTests, givenContextTypeUnrestrictiveWhenBufferIsWritableThenFlipPartialFlagsToFalse) { - DebugManagerStateRestore restorer; - DebugManager.flags.CreateMultipleSubDevices.set(4); - initPlatform(); - - using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; - MockContext context(platform()->getClDevice(0)); - context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE; - - size_t size = 0x1000; - auto retVal = CL_SUCCESS; - auto buffer = std::unique_ptr( - Buffer::create( - &context, - CL_MEM_READ_WRITE, - size, - nullptr, - retVal)); - EXPECT_EQ(CL_SUCCESS, retVal); - - RENDER_SURFACE_STATE surfaceState = FamilyType::cmdInitRenderSurfaceState; - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuPartialWrites()); - - buffer->setArgStateful(&surfaceState, false, false, false, false, context.getDevice(0)->getDevice(), true, true); - - EXPECT_FALSE(surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_FALSE(surfaceState.getDisableSupportForMultiGpuPartialWrites()); -} - -XEHPTEST_F(XeHpSdvBufferTests, givenContextTypeDefaultWhenBufferIsNotWritableThenRemainPartialFlagsToTrue) { - using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; - MockContext context; - context.contextType = ContextType::CONTEXT_TYPE_DEFAULT; - - size_t size = 0x1000; - auto retVal = CL_SUCCESS; - - auto buffer = std::unique_ptr(Buffer::create( - &context, - CL_MEM_READ_ONLY, - size, - nullptr, - retVal)); - EXPECT_EQ(CL_SUCCESS, retVal); - - RENDER_SURFACE_STATE surfaceState = FamilyType::cmdInitRenderSurfaceState; - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuPartialWrites()); - - surfaceState.setDisableSupportForMultiGpuAtomics(false); - surfaceState.setDisableSupportForMultiGpuPartialWrites(false); - buffer->setArgStateful(&surfaceState, false, false, false, false, context.getDevice(0)->getDevice(), true, false); - - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuPartialWrites()); -} - -XEHPTEST_F(XeHpSdvBufferTests, givenContextTypeSpecializedWhenBufferIsWritableThenRemainPartialFlagsToTrue) { - using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; - MockContext context; - context.contextType = ContextType::CONTEXT_TYPE_SPECIALIZED; - - size_t size = 0x1000; - auto retVal = CL_SUCCESS; - - auto buffer = std::unique_ptr(Buffer::create( - &context, - CL_MEM_READ_WRITE, - size, - nullptr, - retVal)); - EXPECT_EQ(CL_SUCCESS, retVal); - - RENDER_SURFACE_STATE surfaceState = FamilyType::cmdInitRenderSurfaceState; - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuPartialWrites()); - - surfaceState.setDisableSupportForMultiGpuAtomics(false); - surfaceState.setDisableSupportForMultiGpuPartialWrites(false); - buffer->setArgStateful(&surfaceState, false, false, false, false, context.getDevice(0)->getDevice(), false, false); - - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuPartialWrites()); -} - -XEHPTEST_F(XeHpSdvBufferTests, givenDebugFlagForMultiTileSupportWhenSurfaceStateIsSetThenValuesMatch) { - DebugManagerStateRestore restore; - using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; - MockContext context; - context.contextType = ContextType::CONTEXT_TYPE_SPECIALIZED; - - size_t size = 0x1000; - auto retVal = CL_SUCCESS; - - auto buffer = std::unique_ptr(Buffer::create( - &context, - CL_MEM_READ_WRITE, - size, - nullptr, - retVal)); - EXPECT_EQ(CL_SUCCESS, retVal); - - RENDER_SURFACE_STATE surfaceState = FamilyType::cmdInitRenderSurfaceState; - - DebugManager.flags.ForceMultiGpuAtomics.set(0); - DebugManager.flags.ForceMultiGpuPartialWrites.set(0); - - buffer->setArgStateful(&surfaceState, false, false, false, false, context.getDevice(0)->getDevice(), false, false); - - EXPECT_EQ(0u, surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_EQ(0u, surfaceState.getDisableSupportForMultiGpuPartialWrites()); - - DebugManager.flags.ForceMultiGpuAtomics.set(1); - DebugManager.flags.ForceMultiGpuPartialWrites.set(1); - - buffer->setArgStateful(&surfaceState, false, false, false, false, context.getDevice(0)->getDevice(), false, false); - - EXPECT_EQ(1u, surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_EQ(1u, surfaceState.getDisableSupportForMultiGpuPartialWrites()); -} - -XEHPTEST_F(XeHpSdvBufferTests, givenNullContextWhenBufferAllocationIsNullThenRemainPartialFlagsToTrue) { - using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; - RENDER_SURFACE_STATE surfaceState = FamilyType::cmdInitRenderSurfaceState; - - auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(defaultHwInfo.get())); - - auto size = MemoryConstants::pageSize; - auto ptr = alignedMalloc(size, MemoryConstants::pageSize); - - surfaceState.setDisableSupportForMultiGpuAtomics(false); - surfaceState.setDisableSupportForMultiGpuPartialWrites(false); - Buffer::setSurfaceState(device.get(), &surfaceState, false, false, size, ptr, 0, nullptr, 0, 0, false, false); - - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuPartialWrites()); - - alignedFree(ptr); -} - -struct MultiGpuGlobalAtomicsBufferTest : public XeHpSdvBufferTests, - public ::testing::WithParamInterface> { -}; - -XEHPTEST_P(MultiGpuGlobalAtomicsBufferTest, givenSetArgStatefulCalledThenDisableSupportForMultiGpuAtomicsIsSetCorrectly) { - unsigned int numAvailableDevices, bufferFlags; - bool useGlobalAtomics, areMultipleSubDevicesInContext, enableMultiGpuAtomicsOptimization; - std::tie(numAvailableDevices, bufferFlags, useGlobalAtomics, areMultipleSubDevicesInContext, enableMultiGpuAtomicsOptimization) = GetParam(); - - DebugManagerStateRestore restorer; - DebugManager.flags.CreateMultipleSubDevices.set(numAvailableDevices); - DebugManager.flags.EnableMultiGpuAtomicsOptimization.set(enableMultiGpuAtomicsOptimization); - initPlatform(); - - if (numAvailableDevices == 1) { - EXPECT_EQ(0u, platform()->getClDevice(0)->getNumGenericSubDevices()); - } else { - EXPECT_EQ(numAvailableDevices, platform()->getClDevice(0)->getNumGenericSubDevices()); - } - using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; - MockContext context(platform()->getClDevice(0)); - context.contextType = ContextType::CONTEXT_TYPE_DEFAULT; - - size_t size = 0x1000; - auto retVal = CL_SUCCESS; - auto buffer = std::unique_ptr( - Buffer::create( - &context, - bufferFlags, - size, - nullptr, - retVal)); - EXPECT_EQ(CL_SUCCESS, retVal); - - RENDER_SURFACE_STATE surfaceState = FamilyType::cmdInitRenderSurfaceState; - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuAtomics()); - - surfaceState.setDisableSupportForMultiGpuAtomics(false); - buffer->setArgStateful(&surfaceState, false, false, false, false, context.getDevice(0)->getDevice(), useGlobalAtomics, areMultipleSubDevicesInContext); - - DeviceBitfield deviceBitfield{static_cast(maxNBitValue(numAvailableDevices))}; - bool implicitScaling = ImplicitScalingHelper::isImplicitScalingEnabled(deviceBitfield, true); - bool enabled = implicitScaling; - - if (enableMultiGpuAtomicsOptimization) { - enabled = useGlobalAtomics && (enabled || areMultipleSubDevicesInContext); - } - - EXPECT_EQ(!enabled, surfaceState.getDisableSupportForMultiGpuAtomics()); -} - -XEHPTEST_P(MultiGpuGlobalAtomicsBufferTest, givenSetSurfaceStateCalledThenDisableSupportForMultiGpuAtomicsIsSetCorrectly) { - unsigned int numAvailableDevices, bufferFlags; - bool useGlobalAtomics, areMultipleSubDevicesInContext, enableMultiGpuAtomicsOptimization; - std::tie(numAvailableDevices, bufferFlags, useGlobalAtomics, areMultipleSubDevicesInContext, enableMultiGpuAtomicsOptimization) = GetParam(); - - DebugManagerStateRestore restorer; - DebugManager.flags.CreateMultipleSubDevices.set(numAvailableDevices); - DebugManager.flags.EnableMultiGpuAtomicsOptimization.set(enableMultiGpuAtomicsOptimization); - initPlatform(); - if (numAvailableDevices == 1) { - EXPECT_EQ(0u, platform()->getClDevice(0)->getNumGenericSubDevices()); - } else { - EXPECT_EQ(numAvailableDevices, platform()->getClDevice(0)->getNumGenericSubDevices()); - } - - auto size = MemoryConstants::pageSize; - auto ptr = alignedMalloc(size, MemoryConstants::pageSize); - MockGraphicsAllocation gfxAllocation(ptr, size); - gfxAllocation.setMemObjectsAllocationWithWritableFlags(bufferFlags == CL_MEM_READ_WRITE); - - using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; - RENDER_SURFACE_STATE surfaceState = FamilyType::cmdInitRenderSurfaceState; - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuAtomics()); - - surfaceState.setDisableSupportForMultiGpuAtomics(false); - Buffer::setSurfaceState(&platform()->getClDevice(0)->getDevice(), &surfaceState, false, false, 0, nullptr, 0, &gfxAllocation, bufferFlags, 0, useGlobalAtomics, areMultipleSubDevicesInContext); - - DeviceBitfield deviceBitfield{static_cast(maxNBitValue(numAvailableDevices))}; - bool implicitScaling = ImplicitScalingHelper::isImplicitScalingEnabled(deviceBitfield, true); - bool enabled = implicitScaling; - - if (enableMultiGpuAtomicsOptimization) { - enabled = useGlobalAtomics && (enabled || areMultipleSubDevicesInContext); - } - - EXPECT_EQ(!enabled, surfaceState.getDisableSupportForMultiGpuAtomics()); - - alignedFree(ptr); -} - -static unsigned int numAvailableDevices[] = {1, 2}; -static unsigned int bufferFlags[] = {CL_MEM_READ_ONLY, CL_MEM_READ_WRITE}; - -INSTANTIATE_TEST_CASE_P(MultiGpuGlobalAtomicsBufferTest, - MultiGpuGlobalAtomicsBufferTest, - ::testing::Combine( - ::testing::ValuesIn(numAvailableDevices), - ::testing::ValuesIn(bufferFlags), - ::testing::Bool(), - ::testing::Bool(), - ::testing::Bool())); \ No newline at end of file diff --git a/opencl/test/unit_test/xe_hp_core/xehp/test_command_stream_receiver_xehp.inl b/opencl/test/unit_test/xe_hp_core/xehp/test_command_stream_receiver_xehp.inl deleted file mode 100644 index aa40bb2b0b..0000000000 --- a/opencl/test/unit_test/xe_hp_core/xehp/test_command_stream_receiver_xehp.inl +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (C) 2021-2022 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/test/common/cmd_parse/hw_parse.h" -#include "shared/test/common/mocks/mock_csr.h" -#include "shared/test/common/mocks/mock_graphics_allocation.h" -#include "shared/test/common/test_macros/test.h" - -#include "opencl/test/unit_test/fixtures/cl_device_fixture.h" - -#include "gtest/gtest.h" - -using namespace NEO; - -class CommandStreamReceiverHwTestWithLocalMemory : public ClDeviceFixture, - public HardwareParse, - public ::testing::Test { - public: - void SetUp() override { - dbgRestore = std::make_unique(); - DebugManager.flags.EnableLocalMemory.set(1); - ClDeviceFixture::setUp(); - HardwareParse::setUp(); - } - void TearDown() override { - HardwareParse::tearDown(); - ClDeviceFixture::tearDown(); - } - - private: - std::unique_ptr dbgRestore; -}; - -XEHPTEST_F(CommandStreamReceiverHwTestWithLocalMemory, givenUseClearColorAllocationForBlitterIsNotSetWhenCallingGetClearColorAllocationThenClearAllocationIsNotCreated) { - DebugManagerStateRestore restore; - DebugManager.flags.UseClearColorAllocationForBlitter.set(false); - - MockCsrHw commandStreamReceiver(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); - commandStreamReceiver.setupContext(pDevice->getGpgpuCommandStreamReceiver().getOsContext()); - - auto gfxAllocation = commandStreamReceiver.getClearColorAllocation(); - EXPECT_EQ(nullptr, gfxAllocation); -} - -XEHPTEST_F(CommandStreamReceiverHwTestWithLocalMemory, givenUseClearColorAllocationForBlitterIsSetWhenCallingGetClearColorAllocationThenClearAllocationIsCreated) { - DebugManagerStateRestore restore; - DebugManager.flags.UseClearColorAllocationForBlitter.set(true); - - MockCsrHw commandStreamReceiver(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); - commandStreamReceiver.setupContext(pDevice->getGpgpuCommandStreamReceiver().getOsContext()); - - auto gfxAllocation = commandStreamReceiver.getClearColorAllocation(); - ASSERT_NE(nullptr, gfxAllocation); - EXPECT_TRUE(gfxAllocation->storageInfo.readOnlyMultiStorage); -} - -XEHPTEST_F(CommandStreamReceiverHwTestWithLocalMemory, givenUseClearColorAllocationForBlitterIsSetWhenClearColorAllocationIsAlreadyCreatedThenCallingGetClearColorAllocationReturnsAlreadyCreatedAllocation) { - DebugManagerStateRestore restore; - DebugManager.flags.UseClearColorAllocationForBlitter.set(true); - - MockCsrHw commandStreamReceiver(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); - commandStreamReceiver.setupContext(pDevice->getGpgpuCommandStreamReceiver().getOsContext()); - - auto mockAllocation = std::make_unique(); - auto expectedResult = mockAllocation.get(); - - commandStreamReceiver.clearColorAllocation = mockAllocation.release(); - - auto gfxAllocation = commandStreamReceiver.getClearColorAllocation(); - EXPECT_EQ(expectedResult, gfxAllocation); -} - -template -struct MockCsrHwWithRace : public MockCsrHw { - MockCsrHwWithRace() = delete; - MockCsrHwWithRace(ExecutionEnvironment &executionEnvironment, - uint32_t rootDeviceIndex, - const DeviceBitfield deviceBitfield) : MockCsrHw(executionEnvironment, rootDeviceIndex, deviceBitfield) { - mockGraphicsAllocation.reset(new MockGraphicsAllocation()); - } - - std::unique_lock obtainUniqueOwnership() override { - if (raceLost) { - this->clearColorAllocation = mockGraphicsAllocation.release(); - } - return MockCsrHw::obtainUniqueOwnership(); - } - - bool raceLost = false; - std::unique_ptr mockGraphicsAllocation; -}; - -XEHPTEST_F(CommandStreamReceiverHwTestWithLocalMemory, givenUseClearColorAllocationForBlitterIsSetWhenCallingGetClearColorAllocationAndRaceIsWonThenClearAllocationIsCreatedInCurrentThread) { - DebugManagerStateRestore restore; - DebugManager.flags.UseClearColorAllocationForBlitter.set(true); - - MockCsrHwWithRace commandStreamReceiver(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); - commandStreamReceiver.setupContext(pDevice->getGpgpuCommandStreamReceiver().getOsContext()); - - auto gfxAllocation = commandStreamReceiver.getClearColorAllocation(); - EXPECT_EQ(commandStreamReceiver.clearColorAllocation, gfxAllocation); - EXPECT_NE(commandStreamReceiver.mockGraphicsAllocation.get(), gfxAllocation); -} - -XEHPTEST_F(CommandStreamReceiverHwTestWithLocalMemory, givenUseClearColorAllocationForBlitterIsSetWhenCallingGetClearColorAllocationAndRaceIsLostThenClearAllocationIsNotCreatedInCurrentThread) { - DebugManagerStateRestore restore; - DebugManager.flags.UseClearColorAllocationForBlitter.set(true); - - MockCsrHwWithRace commandStreamReceiver(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); - commandStreamReceiver.setupContext(pDevice->getGpgpuCommandStreamReceiver().getOsContext()); - commandStreamReceiver.raceLost = true; - - auto expectedClearColorAllocation = commandStreamReceiver.mockGraphicsAllocation.get(); - auto gfxAllocation = commandStreamReceiver.getClearColorAllocation(); - EXPECT_EQ(commandStreamReceiver.clearColorAllocation, gfxAllocation); - EXPECT_EQ(expectedClearColorAllocation, gfxAllocation); -} - -XEHPTEST_F(CommandStreamReceiverHwTestWithLocalMemory, givenEnableStatelessCompressionWhenCallingGetMemoryCompressionStateThenReturnCorrectValue) { - DebugManagerStateRestore restore; - CommandStreamReceiverHw commandStreamReceiver(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()); - - DebugManager.flags.EnableStatelessCompression.set(0); - for (bool auxTranslationRequired : {false, true}) { - auto memoryCompressionState = commandStreamReceiver.getMemoryCompressionState(auxTranslationRequired, pDevice->getHardwareInfo()); - EXPECT_EQ(MemoryCompressionState::NotApplicable, memoryCompressionState); - } - - DebugManager.flags.EnableStatelessCompression.set(1); - for (bool auxTranslationRequired : {false, true}) { - auto memoryCompressionState = commandStreamReceiver.getMemoryCompressionState(auxTranslationRequired, pDevice->getHardwareInfo()); - if (auxTranslationRequired) { - EXPECT_EQ(MemoryCompressionState::Disabled, memoryCompressionState); - } else { - EXPECT_EQ(MemoryCompressionState::Enabled, memoryCompressionState); - } - } -} diff --git a/opencl/test/unit_test/xe_hp_core/xehp/test_device_caps_xehp.inl b/opencl/test/unit_test/xe_hp_core/xehp/test_device_caps_xehp.inl deleted file mode 100644 index 2efbc89844..0000000000 --- a/opencl/test/unit_test/xe_hp_core/xehp/test_device_caps_xehp.inl +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2021-2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/helpers/gfx_core_helper.h" -#include "shared/test/common/test_macros/test.h" - -#include "opencl/test/unit_test/fixtures/cl_device_fixture.h" - -#include "gtest/gtest.h" - -using namespace NEO; - -typedef Test XeHPUsDeviceIdTest; - -XEHPTEST_F(XeHPUsDeviceIdTest, givenXeHPThenDebuggerIsNotSupported) { - EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.debuggerSupported); -} - -XEHPTEST_F(XeHPUsDeviceIdTest, WhenGettingHardwareInfoThenProductFamilyIsXeHpSdv) { - EXPECT_EQ(IGFX_XE_HP_SDV, pDevice->getHardwareInfo().platform.eProductFamily); -} - -XEHPTEST_F(XeHPUsDeviceIdTest, givenXeHPWhenCheckftr64KBpagesThenTrue) { - EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages); -} - -XEHPTEST_F(XeHPUsDeviceIdTest, givenXeHPSkusThenItSupportCorrectlyRoundedDivSqrtBit) { - EXPECT_TRUE(pClDevice->getHardwareInfo().capabilityTable.ftrSupports64BitMath); - cl_device_fp_config actual = pClDevice->getDeviceInfo().singleFpConfig & CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT; - EXPECT_NE(0ull, actual); -} - -XEHPTEST_F(XeHPUsDeviceIdTest, givenXeHPWhenCheckSupportCacheFlushAfterWalkerThenTrue) { - EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportCacheFlushAfterWalker); -} diff --git a/opencl/test/unit_test/xe_hp_core/xehp/test_image_xe_hp_sdv.inl b/opencl/test/unit_test/xe_hp_core/xehp/test_image_xe_hp_sdv.inl deleted file mode 100644 index 344b5d4edd..0000000000 --- a/opencl/test/unit_test/xe_hp_core/xehp/test_image_xe_hp_sdv.inl +++ /dev/null @@ -1,339 +0,0 @@ -/* - * Copyright (C) 2022-2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/test/common/helpers/debug_manager_state_restore.h" -#include "shared/test/common/helpers/unit_test_helper.h" -#include "shared/test/common/mocks/mock_device.h" -#include "shared/test/common/test_macros/test.h" - -#include "opencl/source/cl_device/cl_device.h" -#include "opencl/source/helpers/cl_memory_properties_helpers.h" -#include "opencl/source/mem_obj/image.h" -#include "opencl/test/unit_test/mem_obj/image_compression_fixture.h" -#include "opencl/test/unit_test/mocks/mock_context.h" -#include "opencl/test/unit_test/mocks/mock_platform.h" - -using XeHpSdvImageTests = ::testing::Test; - -XEHPTEST_F(XeHpSdvImageTests, givenContextTypeDefaultWhenImageIsWritableAndOnlyOneTileIsAvailableThenRemainFlagsToTrue) { - DebugManagerStateRestore restorer; - DebugManager.flags.CreateMultipleSubDevices.set(1); - initPlatform(); - EXPECT_EQ(0u, platform()->getClDevice(0)->getNumGenericSubDevices()); - using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; - MockContext context(platform()->getClDevice(0)); - context.contextType = ContextType::CONTEXT_TYPE_DEFAULT; - - cl_int retVal = CL_SUCCESS; - cl_image_format imageFormat = {}; - cl_image_desc imageDesc = {}; - - imageFormat.image_channel_data_type = CL_UNORM_INT8; - imageFormat.image_channel_order = CL_RGBA; - - imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D; - imageDesc.image_height = 128; - imageDesc.image_width = 256; - - auto surfaceFormat = Image::getSurfaceFormatFromTable( - CL_MEM_READ_WRITE, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - auto image = std::unique_ptr(Image::create( - &context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), - CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal)); - auto imageHw = static_cast *>(image.get()); - - RENDER_SURFACE_STATE surfaceState = FamilyType::cmdInitRenderSurfaceState; - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuPartialWrites()); - - surfaceState.setDisableSupportForMultiGpuAtomics(false); - surfaceState.setDisableSupportForMultiGpuPartialWrites(false); - imageHw->appendSurfaceStateParams(&surfaceState, context.getDevice(0)->getRootDeviceIndex(), true); - - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuPartialWrites()); -} - -XEHPTEST_F(XeHpSdvImageTests, givenContextTypeDefaultWhenImageIsWritableThenFlipPartialFlagsToFalse) { - DebugManagerStateRestore restorer; - DebugManager.flags.CreateMultipleSubDevices.set(4); - initPlatform(); - - using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; - MockContext context(platform()->getClDevice(0)); - context.contextType = ContextType::CONTEXT_TYPE_DEFAULT; - - cl_int retVal = CL_SUCCESS; - cl_image_format imageFormat = {}; - cl_image_desc imageDesc = {}; - - imageFormat.image_channel_data_type = CL_UNORM_INT8; - imageFormat.image_channel_order = CL_RGBA; - - imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D; - imageDesc.image_height = 128; - imageDesc.image_width = 256; - - auto surfaceFormat = Image::getSurfaceFormatFromTable( - CL_MEM_READ_WRITE, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - auto image = std::unique_ptr(Image::create( - &context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), - CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal)); - auto imageHw = static_cast *>(image.get()); - - RENDER_SURFACE_STATE surfaceState = FamilyType::cmdInitRenderSurfaceState; - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuPartialWrites()); - - imageHw->appendSurfaceStateParams(&surfaceState, context.getDevice(0)->getRootDeviceIndex(), true); - - EXPECT_FALSE(surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_FALSE(surfaceState.getDisableSupportForMultiGpuPartialWrites()); -} - -XEHPTEST_F(XeHpSdvImageTests, givenDebugFlagForMultiTileSupportWhenSurfaceStateIsProgrammedThenItHasDesiredValues) { - DebugManagerStateRestore restorer; - using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; - MockContext context; - context.contextType = ContextType::CONTEXT_TYPE_DEFAULT; - - cl_int retVal = CL_SUCCESS; - cl_image_format imageFormat = {}; - cl_image_desc imageDesc = {}; - - imageFormat.image_channel_data_type = CL_UNORM_INT8; - imageFormat.image_channel_order = CL_RGBA; - - imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D; - imageDesc.image_height = 128; - imageDesc.image_width = 256; - - auto surfaceFormat = Image::getSurfaceFormatFromTable( - CL_MEM_READ_ONLY, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - auto image = std::unique_ptr(Image::create( - &context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), - CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal)); - auto imageHw = static_cast *>(image.get()); - - RENDER_SURFACE_STATE surfaceState = FamilyType::cmdInitRenderSurfaceState; - - DebugManager.flags.ForceMultiGpuAtomics.set(0); - DebugManager.flags.ForceMultiGpuPartialWrites.set(0); - - imageHw->appendSurfaceStateParams(&surfaceState, context.getDevice(0)->getRootDeviceIndex(), true); - - EXPECT_EQ(0u, surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_EQ(0u, surfaceState.getDisableSupportForMultiGpuPartialWrites()); - - DebugManager.flags.ForceMultiGpuAtomics.set(1); - DebugManager.flags.ForceMultiGpuPartialWrites.set(1); - - imageHw->appendSurfaceStateParams(&surfaceState, context.getDevice(0)->getRootDeviceIndex(), true); - - EXPECT_EQ(1u, surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_EQ(1u, surfaceState.getDisableSupportForMultiGpuPartialWrites()); -} - -XEHPTEST_F(XeHpSdvImageTests, givenContextTypeUnrestrictiveWhenImageIsWritableThenFlipPartialFlagsToFalse) { - DebugManagerStateRestore restorer; - DebugManager.flags.CreateMultipleSubDevices.set(4); - initPlatform(); - - using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; - MockContext context(platform()->getClDevice(0)); - context.contextType = ContextType::CONTEXT_TYPE_UNRESTRICTIVE; - - cl_int retVal = CL_SUCCESS; - cl_image_format imageFormat = {}; - cl_image_desc imageDesc = {}; - - imageFormat.image_channel_data_type = CL_UNORM_INT8; - imageFormat.image_channel_order = CL_RGBA; - - imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D; - imageDesc.image_height = 128; - imageDesc.image_width = 256; - - auto surfaceFormat = Image::getSurfaceFormatFromTable( - CL_MEM_READ_WRITE, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - auto image = std::unique_ptr(Image::create( - &context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), - CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal)); - auto imageHw = static_cast *>(image.get()); - - RENDER_SURFACE_STATE surfaceState = FamilyType::cmdInitRenderSurfaceState; - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuPartialWrites()); - - imageHw->appendSurfaceStateParams(&surfaceState, context.getDevice(0)->getRootDeviceIndex(), true); - - EXPECT_FALSE(surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_FALSE(surfaceState.getDisableSupportForMultiGpuPartialWrites()); -} - -XEHPTEST_F(XeHpSdvImageTests, givenContextTypeDefaultWhenImageIsNotWritableThenRemainPartialFlagsToTrue) { - using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; - MockContext context; - context.contextType = ContextType::CONTEXT_TYPE_DEFAULT; - - cl_int retVal = CL_SUCCESS; - cl_image_format imageFormat = {}; - cl_image_desc imageDesc = {}; - - imageFormat.image_channel_data_type = CL_UNORM_INT8; - imageFormat.image_channel_order = CL_RGBA; - - imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D; - imageDesc.image_height = 128; - imageDesc.image_width = 256; - - auto surfaceFormat = Image::getSurfaceFormatFromTable( - CL_MEM_READ_ONLY, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - auto image = std::unique_ptr(Image::create( - &context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), - CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal)); - auto imageHw = static_cast *>(image.get()); - - RENDER_SURFACE_STATE surfaceState = FamilyType::cmdInitRenderSurfaceState; - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuPartialWrites()); - - surfaceState.setDisableSupportForMultiGpuAtomics(false); - surfaceState.setDisableSupportForMultiGpuPartialWrites(false); - imageHw->appendSurfaceStateParams(&surfaceState, context.getDevice(0)->getRootDeviceIndex(), true); - - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuPartialWrites()); -} - -XEHPTEST_F(XeHpSdvImageTests, givenContextTypeSpecializedWhenImageIsWritableThenRemainPartialFlagsToTrue) { - using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; - MockContext context; - context.contextType = ContextType::CONTEXT_TYPE_SPECIALIZED; - - cl_int retVal = CL_SUCCESS; - cl_image_format imageFormat = {}; - cl_image_desc imageDesc = {}; - - imageFormat.image_channel_data_type = CL_UNORM_INT8; - imageFormat.image_channel_order = CL_RGBA; - - imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D; - imageDesc.image_height = 128; - imageDesc.image_width = 256; - - auto surfaceFormat = Image::getSurfaceFormatFromTable( - CL_MEM_READ_WRITE, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - auto image = std::unique_ptr(Image::create( - &context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()), - CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal)); - auto imageHw = static_cast *>(image.get()); - - RENDER_SURFACE_STATE surfaceState = FamilyType::cmdInitRenderSurfaceState; - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuPartialWrites()); - - surfaceState.setDisableSupportForMultiGpuAtomics(false); - surfaceState.setDisableSupportForMultiGpuPartialWrites(false); - imageHw->appendSurfaceStateParams(&surfaceState, context.getDevice(0)->getRootDeviceIndex(), true); - - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuAtomics()); - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuPartialWrites()); -} - -struct MultiGpuGlobalAtomicsImageTest : public XeHpSdvImageTests, - public ::testing::WithParamInterface> { -}; - -XEHPTEST_P(MultiGpuGlobalAtomicsImageTest, givenAppendSurfaceStateParamCalledThenDisableSupportForMultiGpuAtomicsIsSetCorrectly) { - using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; - unsigned int numAvailableSubDevices, memFlags; - bool useGlobalAtomics, enableMultiGpuAtomicsOptimization; - std::tie(numAvailableSubDevices, memFlags, useGlobalAtomics, enableMultiGpuAtomicsOptimization) = GetParam(); - - DebugManagerStateRestore restorer; - DebugManager.flags.EnableMultiGpuAtomicsOptimization.set(enableMultiGpuAtomicsOptimization); - - UltClDeviceFactory deviceFactory{1, 2}; - - ClDeviceVector deviceVector; - - for (auto i = 0u; i < numAvailableSubDevices; i++) { - deviceVector.push_back(deviceFactory.subDevices[i]); - } - if (deviceVector.empty()) { - deviceVector.push_back(deviceFactory.rootDevices[0]); - } - - MockContext context(deviceVector); - - cl_int retVal = CL_SUCCESS; - cl_image_format imageFormat = {}; - cl_image_desc imageDesc = {}; - - imageFormat.image_channel_data_type = CL_UNORM_INT8; - imageFormat.image_channel_order = CL_RGBA; - - imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D; - imageDesc.image_height = 128; - imageDesc.image_width = 256; - - auto surfaceFormat = Image::getSurfaceFormatFromTable( - memFlags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - auto image = std::unique_ptr(Image::create( - &context, ClMemoryPropertiesHelper::createMemoryProperties(memFlags, 0, 0, &context.getDevice(0)->getDevice()), - memFlags, 0, surfaceFormat, &imageDesc, NULL, retVal)); - auto imageHw = static_cast *>(image.get()); - - RENDER_SURFACE_STATE surfaceState = FamilyType::cmdInitRenderSurfaceState; - EXPECT_TRUE(surfaceState.getDisableSupportForMultiGpuAtomics()); - - surfaceState.setDisableSupportForMultiGpuAtomics(false); - surfaceState.setDisableSupportForMultiGpuPartialWrites(false); - imageHw->appendSurfaceStateParams(&surfaceState, context.getDevice(0)->getRootDeviceIndex(), useGlobalAtomics); - - bool enableGlobalAtomics = numAvailableSubDevices != 1u; - if (enableMultiGpuAtomicsOptimization) { - enableGlobalAtomics &= useGlobalAtomics; - } - EXPECT_EQ(!enableGlobalAtomics, surfaceState.getDisableSupportForMultiGpuAtomics()); -} - -static unsigned int numAvailableSubDevicesForMultiGpuGlobalAtomicsImageTest[] = {0, 1, 2}; -static unsigned int memFlags[] = {CL_MEM_READ_ONLY, CL_MEM_READ_WRITE}; - -INSTANTIATE_TEST_CASE_P(MultiGpuGlobalAtomicsImageTest, - MultiGpuGlobalAtomicsImageTest, - ::testing::Combine( - ::testing::ValuesIn(numAvailableSubDevicesForMultiGpuGlobalAtomicsImageTest), - ::testing::ValuesIn(memFlags), - ::testing::Bool(), - ::testing::Bool())); - -XEHPTEST_F(ImageCompressionTests, givenXeHpCoreAndRedescribableFormatWhenCreatingAllocationThenDoNotPreferCompression) { - MockContext context{}; - imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D; - imageDesc.image_width = 5; - imageDesc.image_height = 5; - - auto surfaceFormat = Image::getSurfaceFormatFromTable( - flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - auto image = std::unique_ptr(Image::create( - mockContext.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), - flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); - ASSERT_NE(nullptr, image); - EXPECT_EQ(defaultHwInfo->capabilityTable.supportsImages, myMemoryManager->capturedPreferCompressed); - - imageFormat.image_channel_order = CL_RG; - surfaceFormat = Image::getSurfaceFormatFromTable( - flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); - image = std::unique_ptr(Image::create( - mockContext.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()), - flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); - ASSERT_NE(nullptr, image); - EXPECT_TRUE(myMemoryManager->capturedPreferCompressed); -} diff --git a/opencl/test/unit_test/xe_hp_core/xehp/test_local_work_size_xehp.inl b/opencl/test/unit_test/xe_hp_core/xehp/test_local_work_size_xehp.inl deleted file mode 100644 index ac8447d754..0000000000 --- a/opencl/test/unit_test/xe_hp_core/xehp/test_local_work_size_xehp.inl +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2021-2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/test/common/helpers/debug_manager_state_restore.h" -#include "shared/test/common/test_macros/test.h" - -#include "opencl/source/command_queue/gpgpu_walker.h" -#include "opencl/test/unit_test/fixtures/cl_device_fixture.h" -#include "opencl/test/unit_test/mocks/mock_buffer.h" -#include "opencl/test/unit_test/mocks/mock_kernel.h" - -using namespace NEO; - -using XeHPComputeWorkgroupSizeTest = Test; - -XEHPTEST_F(XeHPComputeWorkgroupSizeTest, giveXeHpA0WhenKernelIsaIsBelowThresholdAndThereAreNoImageBarriersAndSlmThenSmallWorkgorupSizeIsSelected) { - auto program = std::make_unique(toClDeviceVector(*pClDevice)); - - MockKernelWithInternals mockKernel(*pClDevice); - auto &kernel = *mockKernel.mockKernel; - - kernel.initialize(); - - Vec3 elws{0, 0, 0}; - Vec3 gws{1024, 1, 1}; - Vec3 offset{0, 0, 0}; - DispatchInfo dispatchInfo{pClDevice, &kernel, 1, gws, elws, offset}; - - auto maxWgSize = pClDevice->getSharedDeviceInfo().maxWorkGroupSize; - - auto &hwInfo = *pDevice->getRootDeviceEnvironment().getMutableHardwareInfo(); - const auto &productHelper = *ProductHelper::get(hwInfo.platform.eProductFamily); - hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hwInfo); - { - auto expectedLws = computeWorkgroupSize(dispatchInfo); - EXPECT_EQ(64u, expectedLws.x * expectedLws.y * expectedLws.z); - EXPECT_EQ(64u, expectedLws.x); - } - - mockKernel.mockKernel->slmTotalSize = 1000u; - - { - auto expectedLws = computeWorkgroupSize(dispatchInfo); - EXPECT_EQ(maxWgSize, expectedLws.x * expectedLws.y * expectedLws.z); - EXPECT_EQ(maxWgSize, expectedLws.x); - } - - mockKernel.mockKernel->slmTotalSize = 0u; - mockKernel.kernelInfo.kernelDescriptor.kernelAttributes.barrierCount = 1u; - - { - auto expectedLws = computeWorkgroupSize(dispatchInfo); - EXPECT_EQ(maxWgSize, expectedLws.x * expectedLws.y * expectedLws.z); - EXPECT_EQ(maxWgSize, expectedLws.x); - } - - mockKernel.kernelInfo.kernelDescriptor.kernelAttributes.barrierCount = 0u; - // on B0 algorithm is disabled - hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hwInfo); - { - auto expectedLws = computeWorkgroupSize(dispatchInfo); - EXPECT_EQ(maxWgSize, expectedLws.x * expectedLws.y * expectedLws.z); - EXPECT_EQ(maxWgSize, expectedLws.x); - } -} - -XEHPTEST_F(XeHPComputeWorkgroupSizeTest, givenSmallKernelAndGwsThatIsNotDivisableBySmallerLimitWhenLwsIsComputedThenBigWorgkroupIsSelected) { - auto program = std::make_unique(toClDeviceVector(*pClDevice)); - - MockKernelWithInternals mockKernel(*pClDevice); - auto &kernel = *mockKernel.mockKernel; - - kernel.initialize(); - - Vec3 elws{0, 0, 0}; - Vec3 gws{636056, 1, 1}; - Vec3 offset{0, 0, 0}; - DispatchInfo dispatchInfo{pClDevice, &kernel, 1, gws, elws, offset}; - - auto maxWgSize = pClDevice->getSharedDeviceInfo().maxWorkGroupSize; - - { - auto calculatedLws = computeWorkgroupSize(dispatchInfo); - - auto expectedLws = (maxWgSize < 344) ? 8u : 344u; - - EXPECT_EQ(expectedLws, calculatedLws.x * calculatedLws.y * calculatedLws.z); - EXPECT_EQ(expectedLws, calculatedLws.x); - } -} diff --git a/opencl/test/unit_test/xe_hp_core/xehp/test_platform_caps_xehp.inl b/opencl/test/unit_test/xe_hp_core/xehp/test_platform_caps_xehp.inl deleted file mode 100644 index 731cf10726..0000000000 --- a/opencl/test/unit_test/xe_hp_core/xehp/test_platform_caps_xehp.inl +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2021-2022 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/test/common/test_macros/test.h" - -#include "opencl/test/unit_test/fixtures/platform_fixture.h" - -using namespace NEO; - -struct XE_HP_COREPlatformCaps : public PlatformFixture, public ::testing::Test { - void SetUp() override { - PlatformFixture::setUp(); - } - - void TearDown() override { - PlatformFixture::tearDown(); - } -}; - -XEHPTEST_F(XE_HP_COREPlatformCaps, givenXeHPSkusThenItSupportFP64) { - const auto &caps = pPlatform->getPlatformInfo(); - - EXPECT_NE(std::string::npos, caps.extensions.find(std::string("cl_khr_fp64"))); -} \ No newline at end of file diff --git a/opencl/test/unit_test/xe_hp_core/xehp/test_preamble_xehp.cpp b/opencl/test/unit_test/xe_hp_core/xehp/test_preamble_xehp.cpp deleted file mode 100644 index 36838980ae..0000000000 --- a/opencl/test/unit_test/xe_hp_core/xehp/test_preamble_xehp.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (C) 2021-2022 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/command_stream/stream_properties.h" -#include "shared/source/debug_settings/debug_settings_manager.h" -#include "shared/test/common/fixtures/preamble_fixture.h" -#include "shared/test/common/helpers/debug_manager_state_restore.h" -#include "shared/test/common/test_macros/test.h" - -#include "opencl/source/helpers/hardware_commands_helper.h" - -using namespace NEO; - -using PreambleCfeState = PreambleFixture; -HWTEST2_F(PreambleCfeState, givenXehpAndFlagCFEWeightedDispatchModeDisableSetFalseWhenCallingProgramVFEStateThenFieldWeightedDispatchModeDisableAreNotSet, IsXEHP) { - using CFE_STATE = typename FamilyType::CFE_STATE; - DebugManagerStateRestore dbgRestore; - DebugManager.flags.CFEWeightedDispatchModeDisable.set(false); - - auto pVfeCmd = PreambleHelper::getSpaceForVfeState(&linearStream, *defaultHwInfo, EngineGroupType::RenderCompute); - StreamProperties streamProperties{}; - streamProperties.frontEndState.setProperties(false, false, false, false, *defaultHwInfo); - PreambleHelper::programVfeState(pVfeCmd, *defaultHwInfo, 0u, 0, 0, streamProperties, nullptr); - parseCommands(linearStream); - auto cfeStateIt = find(cmdList.begin(), cmdList.end()); - ASSERT_NE(cmdList.end(), cfeStateIt); - auto cfeState = reinterpret_cast(*cfeStateIt); - - EXPECT_FALSE(cfeState->getWeightedDispatchModeDisable()); -} -HWTEST2_F(PreambleCfeState, givenXehpAndFlagCFEWeightedDispatchModeDisableSetTrueWhenCallingProgramVFEStateThenFieldWeightedDispatchModeDisableAreSet, IsXEHP) { - using CFE_STATE = typename FamilyType::CFE_STATE; - DebugManagerStateRestore dbgRestore; - DebugManager.flags.CFEWeightedDispatchModeDisable.set(true); - - auto pVfeCmd = PreambleHelper::getSpaceForVfeState(&linearStream, *defaultHwInfo, EngineGroupType::RenderCompute); - StreamProperties streamProperties{}; - streamProperties.frontEndState.setProperties(false, false, false, false, *defaultHwInfo); - PreambleHelper::programVfeState(pVfeCmd, *defaultHwInfo, 0u, 0, 0, streamProperties, nullptr); - parseCommands(linearStream); - auto cfeStateIt = find(cmdList.begin(), cmdList.end()); - ASSERT_NE(cmdList.end(), cfeStateIt); - auto cfeState = reinterpret_cast(*cfeStateIt); - - EXPECT_TRUE(cfeState->getWeightedDispatchModeDisable()); -} - -HWTEST2_F(PreambleCfeState, givenXehpAndFlagCFEComputeOverdispatchDisableSetFalseWhenCallingProgramVFEStateThenFieldComputeOverdispatchDisableAreNotSet, IsXEHP) { - using CFE_STATE = typename FamilyType::CFE_STATE; - DebugManagerStateRestore dbgRestore; - DebugManager.flags.CFEComputeOverdispatchDisable.set(false); - - auto pVfeCmd = PreambleHelper::getSpaceForVfeState(&linearStream, *defaultHwInfo, EngineGroupType::RenderCompute); - StreamProperties streamProperties{}; - streamProperties.frontEndState.setProperties(false, false, false, false, *defaultHwInfo); - PreambleHelper::programVfeState(pVfeCmd, *defaultHwInfo, 0u, 0, 0, streamProperties, nullptr); - parseCommands(linearStream); - auto cfeStateIt = find(cmdList.begin(), cmdList.end()); - ASSERT_NE(cmdList.end(), cfeStateIt); - auto cfeState = reinterpret_cast(*cfeStateIt); - - EXPECT_FALSE(cfeState->getComputeOverdispatchDisable()); -} -HWTEST2_F(PreambleCfeState, givenXehpAndFlagCFEComputeOverdispatchDisableSetTrueWhenCallingProgramVFEStateThenFieldComputeOverdispatchDisableAreSet, IsXEHP) { - using CFE_STATE = typename FamilyType::CFE_STATE; - DebugManagerStateRestore dbgRestore; - DebugManager.flags.CFEComputeOverdispatchDisable.set(true); - - auto pVfeCmd = PreambleHelper::getSpaceForVfeState(&linearStream, *defaultHwInfo, EngineGroupType::RenderCompute); - StreamProperties streamProperties{}; - streamProperties.frontEndState.setProperties(false, false, false, false, *defaultHwInfo); - PreambleHelper::programVfeState(pVfeCmd, *defaultHwInfo, 0u, 0, 0, streamProperties, nullptr); - parseCommands(linearStream); - auto cfeStateIt = find(cmdList.begin(), cmdList.end()); - ASSERT_NE(cmdList.end(), cfeStateIt); - auto cfeState = reinterpret_cast(*cfeStateIt); - - EXPECT_TRUE(cfeState->getComputeOverdispatchDisable()); -} - -HWTEST2_F(PreambleCfeState, givenXehpAndDisabledFusedEuWhenCfeStateProgrammedThenFusedEuDispatchSetToTrue, IsXEHP) { - using CFE_STATE = typename FamilyType::CFE_STATE; - - auto hwInfo = *defaultHwInfo; - hwInfo.capabilityTable.fusedEuEnabled = false; - - auto pVfeCmd = PreambleHelper::getSpaceForVfeState(&linearStream, hwInfo, EngineGroupType::RenderCompute); - StreamProperties streamProperties{}; - streamProperties.frontEndState.setProperties(false, false, false, false, hwInfo); - PreambleHelper::programVfeState(pVfeCmd, hwInfo, 0u, 0, 0, streamProperties, nullptr); - parseCommands(linearStream); - auto cfeStateIt = find(cmdList.begin(), cmdList.end()); - ASSERT_NE(cmdList.end(), cfeStateIt); - auto cfeState = reinterpret_cast(*cfeStateIt); - - EXPECT_TRUE(cfeState->getFusedEuDispatch()); -} - -HWTEST2_F(PreambleCfeState, givenXehpAndEnabledFusedEuWhenCfeStateProgrammedThenFusedEuDispatchSetToFalse, IsXEHP) { - using CFE_STATE = typename FamilyType::CFE_STATE; - - auto hwInfo = *defaultHwInfo; - hwInfo.capabilityTable.fusedEuEnabled = true; - - auto pVfeCmd = PreambleHelper::getSpaceForVfeState(&linearStream, hwInfo, EngineGroupType::RenderCompute); - StreamProperties streamProperties{}; - streamProperties.frontEndState.setProperties(false, false, false, false, hwInfo); - PreambleHelper::programVfeState(pVfeCmd, hwInfo, 0u, 0, 0, streamProperties, nullptr); - parseCommands(linearStream); - auto cfeStateIt = find(cmdList.begin(), cmdList.end()); - ASSERT_NE(cmdList.end(), cfeStateIt); - auto cfeState = reinterpret_cast(*cfeStateIt); - - EXPECT_FALSE(cfeState->getFusedEuDispatch()); -} \ No newline at end of file diff --git a/opencl/test/unit_test/xe_hp_core/xehp/test_product_helper_xehp.inl b/opencl/test/unit_test/xe_hp_core/xehp/test_product_helper_xehp.inl deleted file mode 100644 index 6696c521d4..0000000000 --- a/opencl/test/unit_test/xe_hp_core/xehp/test_product_helper_xehp.inl +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (C) 2021-2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/command_stream/stream_properties.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/test/common/fixtures/device_fixture.h" -#include "shared/test/common/helpers/gfx_core_helper_tests.h" -#include "shared/test/common/helpers/gtest_helpers.h" -#include "shared/test/common/mocks/mock_device.h" -#include "shared/test/common/test_macros/test.h" - -#include "opencl/source/command_queue/command_queue_hw.h" -#include "opencl/test/unit_test/mocks/mock_cl_device.h" -#include "opencl/test/unit_test/mocks/mock_context.h" - -#include "gtest/gtest.h" - -using namespace NEO; - -using XeHPProductHelper = Test; - -XEHPTEST_F(XeHPProductHelper, givenXeHPMultiConfigWhenConfigureHardwareCustomIsCalledThenCapabilityTableIsSetProperly) { - auto &productHelper = getHelper(); - HardwareInfo hwInfo = *defaultHwInfo; - hwInfo.featureTable.flags.ftrE2ECompression = true; - - hwInfo.gtSystemInfo.EUCount = 256u; - productHelper.configureHardwareCustom(&hwInfo, nullptr); - EXPECT_FALSE(hwInfo.capabilityTable.ftrRenderCompressedBuffers); - EXPECT_FALSE(hwInfo.capabilityTable.ftrRenderCompressedImages); - - hwInfo.gtSystemInfo.EUCount = 512u; - productHelper.configureHardwareCustom(&hwInfo, nullptr); - EXPECT_TRUE(hwInfo.capabilityTable.ftrRenderCompressedBuffers); - EXPECT_TRUE(hwInfo.capabilityTable.ftrRenderCompressedImages); -} - -XEHPTEST_F(XeHPProductHelper, givenXeHPWhenConfiguringThenDisableRcs) { - auto &productHelper = getHelper(); - HardwareInfo hwInfo = *defaultHwInfo; - - productHelper.configureHardwareCustom(&hwInfo, nullptr); - EXPECT_FALSE(hwInfo.featureTable.flags.ftrRcsNode); -} - -XEHPTEST_F(XeHPProductHelper, givenDebugVariableSetWhenConfiguringThenEnableRcs) { - DebugManagerStateRestore restore; - DebugManager.flags.NodeOrdinal.set(static_cast(aub_stream::EngineType::ENGINE_RCS)); - - auto &productHelper = getHelper(); - HardwareInfo hwInfo = *defaultHwInfo; - - productHelper.configureHardwareCustom(&hwInfo, nullptr); - EXPECT_TRUE(hwInfo.featureTable.flags.ftrRcsNode); -} - -XEHPTEST_F(XeHPProductHelper, givenXeHpWhenCallingGetDeviceMemoryNameThenHbmIsReturned) { - auto productHelper = ProductHelper::get(productFamily); - auto deviceMemoryName = productHelper->getDeviceMemoryName(); - EXPECT_TRUE(hasSubstr(deviceMemoryName, std::string("HBM"))); -} - -XEHPTEST_F(XeHPProductHelper, givenA0OrA1SteppingWhenAskingIfExtraParametersAreInvalidThenReturnTrue) { - auto &productHelper = getHelper(); - std::array, 4> revisions = { - {{REVISION_A0, true}, - {REVISION_A1, true}, - {REVISION_B, false}, - {REVISION_C, false}}}; - - for (const auto &[revision, paramBool] : revisions) { - auto hwInfo = *defaultHwInfo; - hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(revision, hwInfo); - - productHelper.configureHardwareCustom(&hwInfo, nullptr); - - EXPECT_EQ(paramBool, productHelper.extraParametersInvalid(hwInfo)); - } -} - -using XeHPGfxCoreHelperTest = GfxCoreHelperTest; - -XEHPTEST_F(XeHPGfxCoreHelperTest, givenXeHPMultiConfigWhenAllowCompressionIsCalledThenCorrectValueIsReturned) { - auto productHelper = ProductHelper::get(productFamily); - HardwareInfo hwInfo = *defaultHwInfo; - - hwInfo.gtSystemInfo.EUCount = 512u; - EXPECT_TRUE(productHelper->allowCompression(hwInfo)); - - hwInfo.gtSystemInfo.EUCount = 256u; - EXPECT_FALSE(productHelper->allowCompression(hwInfo)); -} - -XEHPTEST_F(XeHPProductHelper, givenProductHelperWhenAdditionalKernelExecInfoSupportCheckedThenCorrectValueIsReturned) { - auto &productHelper = *ProductHelper::get(productFamily); - auto hwInfo = *defaultHwInfo; - hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hwInfo); - EXPECT_FALSE(productHelper.isDisableOverdispatchAvailable(hwInfo)); - - FrontEndPropertiesSupport fePropertiesSupport{}; - productHelper.fillFrontEndPropertiesSupportStructure(fePropertiesSupport, hwInfo); - EXPECT_FALSE(fePropertiesSupport.disableOverdispatch); - - hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hwInfo); - EXPECT_TRUE(productHelper.isDisableOverdispatchAvailable(hwInfo)); - - productHelper.fillFrontEndPropertiesSupportStructure(fePropertiesSupport, hwInfo); - EXPECT_TRUE(fePropertiesSupport.disableOverdispatch); -} - -XEHPTEST_F(XeHPProductHelper, givenProductHelperWithMultipleCSSWhenIsPipeControlPriorToNonPipelinedStateCommandsWARequiredIsCalledThenTrueIsReturned) { - const auto &productHelper = *ProductHelper::get(productFamily); - auto hwInfo = *defaultHwInfo; - hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 2; - auto isRcs = false; - - const auto &[isBasicWARequired, isExtendedWARequired] = productHelper.isPipeControlPriorToNonPipelinedStateCommandsWARequired(hwInfo, isRcs); - - EXPECT_TRUE(isExtendedWARequired); - EXPECT_TRUE(isBasicWARequired); -} - -XEHPTEST_F(XeHPProductHelper, givenProgramExtendedPipeControlPriorToNonPipelinedStateCommandEnabledWhenIsPipeControlPriorToNonPipelinedStateCommandsWARequiredIsCalledThenTrueIsReturned) { - DebugManagerStateRestore restorer; - DebugManager.flags.ProgramExtendedPipeControlPriorToNonPipelinedStateCommand.set(true); - - const auto &productHelper = *ProductHelper::get(productFamily); - auto hwInfo = *defaultHwInfo; - auto isRcs = false; - - const auto &[isBasicWARequired, isExtendedWARequired] = productHelper.isPipeControlPriorToNonPipelinedStateCommandsWARequired(hwInfo, isRcs); - - EXPECT_TRUE(isExtendedWARequired); - EXPECT_TRUE(isBasicWARequired); -} - -XEHPTEST_F(XeHPProductHelper, givenProgramExtendedPipeControlPriorToNonPipelinedStateCommandDisabledWhenIsPipeControlPriorToNonPipelinedStateCommandsWARequiredIsCalledThenFalseIsReturned) { - DebugManagerStateRestore restorer; - DebugManager.flags.ProgramExtendedPipeControlPriorToNonPipelinedStateCommand.set(0); - - const auto &productHelper = *ProductHelper::get(productFamily); - auto hwInfo = *defaultHwInfo; - auto isRcs = false; - - const auto &[isBasicWARequired, isExtendedWARequired] = productHelper.isPipeControlPriorToNonPipelinedStateCommandsWARequired(hwInfo, isRcs); - - EXPECT_FALSE(isExtendedWARequired); - EXPECT_TRUE(isBasicWARequired); -} diff --git a/opencl/test/unit_test/xe_hp_core/xehp/test_sub_devices_xehp.inl b/opencl/test/unit_test/xe_hp_core/xehp/test_sub_devices_xehp.inl deleted file mode 100644 index c0333b2f51..0000000000 --- a/opencl/test/unit_test/xe_hp_core/xehp/test_sub_devices_xehp.inl +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2021-2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/os_interface/product_helper.h" -#include "shared/test/common/helpers/debug_manager_state_restore.h" -#include "shared/test/common/mocks/mock_memory_manager.h" -#include "shared/test/common/test_macros/test.h" - -#include "opencl/test/unit_test/fixtures/cl_device_fixture.h" -#include "opencl/test/unit_test/mocks/mock_cl_device.h" - -using namespace NEO; - -using XeHPUsDeviceIdTest = Test; - -HWTEST_EXCLUDE_PRODUCT(SubDeviceTests, givenCCSEngineWhenCallingGetDefaultEngineWithWaThenTheSameEngineIsReturned, IGFX_XE_HP_SDV); - -XEHPTEST_F(XeHPUsDeviceIdTest, givenRevisionAWhenCreatingEngineWithSubdevicesThenEngineTypeIsSetToCCS) { - DebugManagerStateRestore restorer; - DebugManager.flags.CreateMultipleSubDevices.set(2); - - auto executionEnvironment = new MockExecutionEnvironment; - MockDevice device(executionEnvironment, 0); - EXPECT_EQ(0u, device.allEngines.size()); - device.createSubDevices(); - device.createEngines(); - EXPECT_EQ(2u, device.getNumGenericSubDevices()); - - auto hwInfo = device.getRootDeviceEnvironment().getMutableHardwareInfo(); - const auto &productHelper = *ProductHelper::get(hwInfo->platform.eProductFamily); - hwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, *hwInfo); - device.createEngines(); - auto engines = device.getAllEngines(); - for (auto engine : engines) { - EXPECT_EQ(aub_stream::ENGINE_CCS, engine.osContext->getEngineType()); - } -} - -XEHPTEST_F(XeHPUsDeviceIdTest, givenRevisionBWhenCreatingEngineWithSubdevicesThenEngineTypeIsSetToCCS) { - DebugManagerStateRestore restorer; - DebugManager.flags.CreateMultipleSubDevices.set(2); - - auto executionEnvironment = new MockExecutionEnvironment; - MockDevice device(executionEnvironment, 0); - EXPECT_EQ(0u, device.allEngines.size()); - device.createSubDevices(); - device.createEngines(); - EXPECT_EQ(2u, device.getNumGenericSubDevices()); - - auto hwInfo = device.getRootDeviceEnvironment().getMutableHardwareInfo(); - const auto &productHelper = *ProductHelper::get(hwInfo->platform.eProductFamily); - hwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, *hwInfo); - device.createEngines(); - auto engines = device.getAllEngines(); - for (auto engine : engines) { - EXPECT_EQ(aub_stream::ENGINE_CCS, engine.osContext->getEngineType()); - } -} diff --git a/opencl/test/unit_test/xe_hp_core/xehp/test_wrapper_xehp.cpp b/opencl/test/unit_test/xe_hp_core/xehp/test_wrapper_xehp.cpp deleted file mode 100644 index 5751424a95..0000000000 --- a/opencl/test/unit_test/xe_hp_core/xehp/test_wrapper_xehp.cpp +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (C) 2021-2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "cache_flush_tests_xehp.inl" -#include "get_device_info_xehp.inl" -#include "gfx_core_helper_tests_xehp.inl" -#include "hw_info_tests_xehp.inl" -#include "memory_manager_tests_xehp.inl" -#include "sampler_tests_xehp.inl" -#include "test_buffer_xe_hp_sdv.inl" -#include "test_command_stream_receiver_xehp.inl" -#include "test_device_caps_xehp.inl" -#include "test_image_xe_hp_sdv.inl" -#include "test_local_work_size_xehp.inl" -#include "test_platform_caps_xehp.inl" -#include "test_product_helper_xehp.inl" -#include "test_sub_devices_xehp.inl" diff --git a/shared/test/unit_test/xe_hp_core/xe_hp_sdv/CMakeLists.txt b/shared/test/unit_test/xe_hp_core/xe_hp_sdv/CMakeLists.txt deleted file mode 100644 index a40de9fe08..0000000000 --- a/shared/test/unit_test/xe_hp_core/xe_hp_sdv/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (C) 2022-2023 Intel Corporation -# -# SPDX-License-Identifier: MIT -# - -if(TESTS_XE_HP_SDV) - target_sources(neo_shared_tests PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt - ${CMAKE_CURRENT_SOURCE_DIR}/product_helper_tests_xe_hp_sdv.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_preamble_xe_hp_sdv.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_preemption_xe_hp_sdv.cpp - ) - - add_subdirectories() -endif() diff --git a/shared/test/unit_test/xe_hp_core/xe_hp_sdv/linux/CMakeLists.txt b/shared/test/unit_test/xe_hp_core/xe_hp_sdv/linux/CMakeLists.txt deleted file mode 100644 index db54a39786..0000000000 --- a/shared/test/unit_test/xe_hp_core/xe_hp_sdv/linux/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (C) 2022-2023 Intel Corporation -# -# SPDX-License-Identifier: MIT -# - -if(UNIX) - target_sources(neo_shared_tests PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/product_helper_tests_xe_hp_sdv.cpp - ) - - add_subdirectories() -endif() diff --git a/shared/test/unit_test/xe_hp_core/xe_hp_sdv/linux/product_helper_tests_xe_hp_sdv.cpp b/shared/test/unit_test/xe_hp_core/xe_hp_sdv/linux/product_helper_tests_xe_hp_sdv.cpp deleted file mode 100644 index 61911e641e..0000000000 --- a/shared/test/unit_test/xe_hp_core/xe_hp_sdv/linux/product_helper_tests_xe_hp_sdv.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2021-2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/os_interface/os_interface.h" -#include "shared/test/common/helpers/default_hw_info.h" -#include "shared/test/common/helpers/gtest_helpers.h" -#include "shared/test/common/libult/linux/drm_mock.h" -#include "shared/test/unit_test/os_interface/linux/product_helper_linux_tests.h" - -using namespace NEO; - -struct XeHpSdvProductHelperLinux : ProductHelperTestLinux { - void SetUp() override { - ProductHelperTestLinux::SetUp(); - - drm = new DrmMock(*executionEnvironment->rootDeviceEnvironments[0]); - osInterface->setDriverModel(std::unique_ptr(drm)); - } -}; - -XEHPTEST_F(XeHpSdvProductHelperLinux, WhenConfiguringHwInfoThenZeroIsReturned) { - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); -} - -XEHPTEST_F(XeHpSdvProductHelperLinux, GivenXeHpSdvWhenConfigureHardwareCustomThenKmdNotifyIsEnabled) { - - productHelper->configureHardwareCustom(&pInHwInfo, osInterface); - EXPECT_TRUE(pInHwInfo.capabilityTable.kmdNotifyProperties.enableKmdNotify); - EXPECT_EQ(150ll, pInHwInfo.capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds); - EXPECT_TRUE(pInHwInfo.capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForDirectSubmission); - EXPECT_EQ(20ll, pInHwInfo.capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForDirectSubmissionMicroseconds); -} diff --git a/shared/test/unit_test/xe_hp_core/xe_hp_sdv/product_helper_tests_xe_hp_sdv.cpp b/shared/test/unit_test/xe_hp_core/xe_hp_sdv/product_helper_tests_xe_hp_sdv.cpp deleted file mode 100644 index 1af510868c..0000000000 --- a/shared/test/unit_test/xe_hp_core/xe_hp_sdv/product_helper_tests_xe_hp_sdv.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2022-2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/xe_hp_core/hw_cmds_xe_hp_sdv.h" -#include "shared/test/common/helpers/default_hw_info.h" -#include "shared/test/common/test_macros/header/per_product_test_definitions.h" -#include "shared/test/common/test_macros/test.h" -#include "shared/test/unit_test/os_interface/product_helper_tests.h" - -#include "aubstream/product_family.h" - -using namespace NEO; - -using XeHpSdvProductHelper = ProductHelperTest; - -XEHPTEST_F(XeHpSdvProductHelper, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) { - EXPECT_EQ(aub_stream::ProductFamily::XeHpSdv, productHelper->getAubStreamProductFamily()); -} - -XEHPTEST_F(XeHpSdvProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) { - - EXPECT_TRUE(productHelper->isEvictionIfNecessaryFlagSupported()); -} - -XEHPTEST_F(XeHpSdvProductHelper, givenProductHelperWhenGetCommandsStreamPropertiesSupportThenExpectCorrectValues) { - - EXPECT_FALSE(productHelper->getScmPropertyThreadArbitrationPolicySupport()); - EXPECT_TRUE(productHelper->getScmPropertyCoherencyRequiredSupport()); - EXPECT_FALSE(productHelper->getScmPropertyZPassAsyncComputeThreadLimitSupport()); - EXPECT_FALSE(productHelper->getScmPropertyPixelAsyncComputeThreadLimitSupport()); - EXPECT_TRUE(productHelper->getScmPropertyLargeGrfModeSupport()); - EXPECT_FALSE(productHelper->getScmPropertyDevicePreemptionModeSupport()); - - EXPECT_TRUE(productHelper->getStateBaseAddressPropertyGlobalAtomicsSupport()); - EXPECT_TRUE(productHelper->getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport()); - - EXPECT_TRUE(productHelper->getFrontEndPropertyScratchSizeSupport()); - EXPECT_TRUE(productHelper->getFrontEndPropertyPrivateScratchSizeSupport()); - - EXPECT_TRUE(productHelper->getPreemptionDbgPropertyPreemptionModeSupport()); - EXPECT_TRUE(productHelper->getPreemptionDbgPropertyStateSipSupport()); - EXPECT_FALSE(productHelper->getPreemptionDbgPropertyCsrSurfaceSupport()); - - EXPECT_FALSE(productHelper->getFrontEndPropertyComputeDispatchAllWalkerSupport()); - EXPECT_FALSE(productHelper->getFrontEndPropertyDisableEuFusionSupport()); - EXPECT_TRUE(productHelper->getFrontEndPropertyDisableOverDispatchSupport()); - EXPECT_TRUE(productHelper->getFrontEndPropertySingleSliceDispatchCcsModeSupport()); - - EXPECT_TRUE(productHelper->getPipelineSelectPropertyMediaSamplerDopClockGateSupport()); - EXPECT_TRUE(productHelper->getPipelineSelectPropertySystolicModeSupport()); -} diff --git a/shared/test/unit_test/xe_hp_core/xe_hp_sdv/test_preamble_xe_hp_sdv.cpp b/shared/test/unit_test/xe_hp_core/xe_hp_sdv/test_preamble_xe_hp_sdv.cpp deleted file mode 100644 index 5a9196d4d4..0000000000 --- a/shared/test/unit_test/xe_hp_core/xe_hp_sdv/test_preamble_xe_hp_sdv.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (C) 2021-2022 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/command_stream/preemption.h" -#include "shared/source/command_stream/stream_properties.h" -#include "shared/source/helpers/preamble.h" -#include "shared/source/xe_hp_core/hw_cmds.h" -#include "shared/test/common/cmd_parse/hw_parse.h" -#include "shared/test/common/mocks/mock_device.h" -#include "shared/test/common/mocks/mock_graphics_allocation.h" -#include "shared/test/common/test_macros/header/per_product_test_definitions.h" -#include "shared/test/common/test_macros/test.h" - -using namespace NEO; - -struct XeHPSlm : HardwareParse, ::testing::Test { - void SetUp() override { - HardwareParse::setUp(); - } - - void TearDown() override { - HardwareParse::tearDown(); - } - - uint32_t cmdBuffer[1024]{}; - MockGraphicsAllocation gfxAllocation{cmdBuffer, sizeof(cmdBuffer)}; - LinearStream linearStream{&gfxAllocation}; -}; - -XEHPTEST_F(XeHPSlm, givenTglWhenPreambleIsBeingProgrammedThenThreadArbitrationPolicyIsIgnored) { - typedef XeHpFamily::MI_LOAD_REGISTER_IMM MI_LOAD_REGISTER_IMM; - LinearStream &cs = linearStream; - uint32_t l3Config = PreambleHelper::getL3Config(*defaultHwInfo, true); - MockDevice mockDevice; - PreambleHelper::programPreamble(&linearStream, mockDevice, l3Config, - nullptr, nullptr); - - parseCommands(cs); - - // parse through commands and ensure that 0xE404 is not being programmed - EXPECT_EQ(0U, countMmio(cmdList.begin(), cmdList.end(), 0xE404)); -} - -XEHPTEST_F(XeHPSlm, WhenProgrammingL3ThenLoadRegisterImmNotUsed) { - typedef XeHpFamily::MI_LOAD_REGISTER_IMM MI_LOAD_REGISTER_IMM; - LinearStream &cs = linearStream; - uint32_t l3Config = PreambleHelper::getL3Config(*defaultHwInfo, true); - PreambleHelper::programL3(&cs, l3Config); - - parseCommands(cs); - - auto itorLRI = find(cmdList.begin(), cmdList.end()); - ASSERT_EQ(cmdList.end(), itorLRI); -} - -using XeHPUrbEntryAllocationSize = ::testing::Test; -XEHPTEST_F(XeHPUrbEntryAllocationSize, WhenGettingUrbEntryAllocationSizeTheZeroIsReturned) { - uint32_t actualVal = PreambleHelper::getUrbEntryAllocationSize(); - EXPECT_EQ(0u, actualVal); -} - -using XeHPPreambleVfeState = XeHPSlm; -XEHPTEST_F(XeHPPreambleVfeState, givenDefaultPipeControlWhenItIsProgrammedThenCsStallBitIsSet) { - using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; - - PIPE_CONTROL *pipeControl = static_cast(linearStream.getSpace(sizeof(PIPE_CONTROL))); - *pipeControl = FamilyType::cmdInitPipeControl; - - EXPECT_EQ(1u, pipeControl->getCommandStreamerStallEnable()); -} - -XEHPTEST_F(XeHPPreambleVfeState, whenProgrammingComputeWalkerThenUavFieldsSetToZero) { - using COMPUTE_WALKER = typename FamilyType::COMPUTE_WALKER; - - COMPUTE_WALKER *computeWalker = static_cast(linearStream.getSpace(sizeof(COMPUTE_WALKER))); - *computeWalker = FamilyType::cmdInitGpgpuWalker; - - EXPECT_FALSE(computeWalker->getUavWaitToProduce()); - EXPECT_FALSE(computeWalker->getUavProducer()); - EXPECT_FALSE(computeWalker->getUavConsumer()); -} - -XEHPTEST_F(XeHPPreambleVfeState, whenProgrammingVfeStateThenDoNotAddPipeControlWaCmd) { - LinearStream &cs = linearStream; - - size_t sizeBefore = cs.getUsed(); - PreambleHelper::addPipeControlBeforeVfeCmd(&cs, defaultHwInfo.get(), EngineGroupType::RenderCompute); - size_t sizeAfter = cs.getUsed(); - - EXPECT_EQ(sizeBefore, sizeAfter); -} - -XEHPTEST_F(XeHPPreambleVfeState, WhenProgramVFEStateIsCalledThenCorrectCfeStateAddressIsReturned) { - using CFE_STATE = typename FamilyType::CFE_STATE; - - char buffer[64]; - MockGraphicsAllocation graphicsAllocation(buffer, sizeof(buffer)); - LinearStream preambleStream(&graphicsAllocation, graphicsAllocation.getUnderlyingBuffer(), graphicsAllocation.getUnderlyingBufferSize()); - uint64_t addressToPatch = 0xC0DEC0DE; - uint64_t expectedAddress = 0xDEC0C0; - - auto pCfeCmd = PreambleHelper::getSpaceForVfeState(&preambleStream, *defaultHwInfo, EngineGroupType::RenderCompute); - StreamProperties emptyProperties{}; - PreambleHelper::programVfeState(pCfeCmd, *defaultHwInfo, 1024u, addressToPatch, 10u, emptyProperties, nullptr); - EXPECT_GE(reinterpret_cast(pCfeCmd), reinterpret_cast(preambleStream.getCpuBase())); - EXPECT_LT(reinterpret_cast(pCfeCmd), reinterpret_cast(preambleStream.getCpuBase()) + preambleStream.getUsed()); - - auto &cfeCmd = *reinterpret_cast(pCfeCmd); - EXPECT_EQ(10u, cfeCmd.getMaximumNumberOfThreads()); - EXPECT_EQ(1u, cfeCmd.getNumberOfWalkers()); - EXPECT_EQ(expectedAddress, cfeCmd.getScratchSpaceBuffer()); -} - -using XeHPPipelineSelect = ::testing::Test; - -XEHPTEST_F(XeHPPipelineSelect, WhenAppendProgramPipelineSelectThenCorrectValuesSet) { - using PIPELINE_SELECT = typename FamilyType::PIPELINE_SELECT; - - constexpr size_t buffSize = 32; - char buffer[buffSize]; - LinearStream stream(buffer, buffSize); - - PipelineSelectArgs pipelineSelectArgs; - pipelineSelectArgs.systolicPipelineSelectSupport = true; - - pipelineSelectArgs.systolicPipelineSelectMode = true; - PreambleHelper::programPipelineSelect(&stream, - pipelineSelectArgs, - *defaultHwInfo); - size_t usedSize = stream.getUsed(); - - auto pipelineSelectCmd = genCmdCast(buffer); - ASSERT_NE(nullptr, pipelineSelectCmd); - EXPECT_TRUE(pipelineSelectCmd->getSystolicModeEnable()); - uint32_t systolicBit = pipelineSelectSystolicModeEnableMaskBits & pipelineSelectCmd->getMaskBits(); - EXPECT_NE(0u, systolicBit); - - pipelineSelectArgs.systolicPipelineSelectMode = false; - PreambleHelper::programPipelineSelect(&stream, - pipelineSelectArgs, - *defaultHwInfo); - - pipelineSelectCmd = genCmdCast(ptrOffset(buffer, usedSize)); - ASSERT_NE(nullptr, pipelineSelectCmd); - EXPECT_FALSE(pipelineSelectCmd->getSystolicModeEnable()); - systolicBit = pipelineSelectSystolicModeEnableMaskBits & pipelineSelectCmd->getMaskBits(); - EXPECT_NE(0u, systolicBit); -} - -XEHPTEST_F(XeHPPipelineSelect, WhenProgramPipelineSelectThenProgramMediaSamplerDopClockGateEnable) { - using PIPELINE_SELECT = typename FamilyType::PIPELINE_SELECT; - PIPELINE_SELECT cmd = FamilyType::cmdInitPipelineSelect; - LinearStream pipelineSelectStream(&cmd, sizeof(cmd)); - PreambleHelper::programPipelineSelect(&pipelineSelectStream, {}, *defaultHwInfo); - - auto expectedSubMask = pipelineSelectMediaSamplerDopClockGateMaskBits; - - EXPECT_TRUE(cmd.getMediaSamplerDopClockGateEnable()); - EXPECT_EQ(expectedSubMask, (cmd.getMaskBits() & expectedSubMask)); -} diff --git a/shared/test/unit_test/xe_hp_core/xe_hp_sdv/test_preemption_xe_hp_sdv.cpp b/shared/test/unit_test/xe_hp_core/xe_hp_sdv/test_preemption_xe_hp_sdv.cpp deleted file mode 100644 index 0e545f8ff2..0000000000 --- a/shared/test/unit_test/xe_hp_core/xe_hp_sdv/test_preemption_xe_hp_sdv.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (C) 2021-2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/built_ins/sip.h" -#include "shared/source/command_stream/preemption.h" -#include "shared/source/helpers/hw_info.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/xe_hp_core/hw_cmds.h" -#include "shared/test/common/cmd_parse/hw_parse.h" -#include "shared/test/common/mocks/mock_debugger.h" -#include "shared/test/common/mocks/mock_device.h" -#include "shared/test/common/test_macros/header/per_product_test_definitions.h" -#include "shared/test/common/test_macros/test.h" - -#include - -using namespace NEO; - -using PreemptionXeHPTest = ::testing::Test; - -XEHPTEST_F(PreemptionXeHPTest, givenRevisionA0toBWhenProgrammingSipThenGlobalSipIsSet) { - using PIPE_CONTROL = XeHpFamily::PIPE_CONTROL; - using MI_LOAD_REGISTER_IMM = XeHpFamily::MI_LOAD_REGISTER_IMM; - using STATE_SIP = XeHpFamily::STATE_SIP; - HardwareInfo hwInfo = *NEO::defaultHwInfo.get(); - - const auto &productHelper = *ProductHelper::get(hwInfo.platform.eProductFamily); - - std::array revisions = {productHelper.getHwRevIdFromStepping(REVID::REVISION_A0, hwInfo), - productHelper.getHwRevIdFromStepping(REVID::REVISION_B, hwInfo)}; - - for (auto revision : revisions) { - hwInfo.platform.usRevId = revision; - - std::unique_ptr mockDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - mockDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->debugger.reset(new MockDebugger); - auto sipAllocation = SipKernel::getSipKernel(*mockDevice).getSipAllocation(); - - size_t requiredSize = PreemptionHelper::getRequiredStateSipCmdSize(*mockDevice, false); - StackVec streamStorage(1024); - LinearStream cmdStream{streamStorage.begin(), streamStorage.size()}; - - auto expectedGlobalSipWaSize = sizeof(PIPE_CONTROL) + 2 * sizeof(MI_LOAD_REGISTER_IMM); - EXPECT_EQ(expectedGlobalSipWaSize, requiredSize); - PreemptionHelper::programStateSip(cmdStream, *mockDevice, nullptr, nullptr); - EXPECT_NE(0U, cmdStream.getUsed()); - - GenCmdList cmdList; - ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(cmdStream.getCpuBase(), 0), cmdStream.getUsed())); - - auto itorLRI = findMmio(cmdList.begin(), cmdList.end(), 0xE42C); - EXPECT_NE(cmdList.end(), itorLRI); - - auto cmdLRI = genCmdCast(*itorLRI); - auto sipAddress = cmdLRI->getDataDword() & 0xfffffff8; - EXPECT_EQ(sipAllocation->getGpuAddressToPatch(), sipAddress); - } -} - -XEHPTEST_F(PreemptionXeHPTest, givenRevisionA0toBWhenProgrammingSipEndWaThenGlobalSipIsRestored) { - using PIPE_CONTROL = XeHpFamily::PIPE_CONTROL; - using MI_LOAD_REGISTER_IMM = XeHpFamily::MI_LOAD_REGISTER_IMM; - using STATE_SIP = XeHpFamily::STATE_SIP; - HardwareInfo hwInfo = *NEO::defaultHwInfo.get(); - - const auto &productHelper = *ProductHelper::get(hwInfo.platform.eProductFamily); - - std::array revisions = {productHelper.getHwRevIdFromStepping(REVID::REVISION_A0, hwInfo), - productHelper.getHwRevIdFromStepping(REVID::REVISION_B, hwInfo)}; - - for (auto revision : revisions) { - hwInfo.platform.usRevId = revision; - - std::unique_ptr mockDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - mockDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->debugger.reset(new MockDebugger); - - StackVec streamStorage(1024); - LinearStream cmdStream{streamStorage.begin(), streamStorage.size()}; - - PreemptionHelper::programStateSipEndWa(cmdStream, hwInfo, true); - EXPECT_NE(0U, cmdStream.getUsed()); - - GenCmdList cmdList; - ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( - cmdList, ptrOffset(cmdStream.getCpuBase(), 0), cmdStream.getUsed())); - - auto itorPC = find(cmdList.begin(), cmdList.end()); - EXPECT_NE(cmdList.end(), itorPC); - - auto itorLRI = findMmio(itorPC, cmdList.end(), 0xE42C); - EXPECT_NE(cmdList.end(), itorLRI); - - auto cmdLRI = genCmdCast(*itorLRI); - auto sipAddress = cmdLRI->getDataDword() & 0xfffffff8; - EXPECT_EQ(0u, sipAddress); - } -} diff --git a/target_unit_tests/xe_hp_core/xe_hp_sdv/CMakeLists.txt b/target_unit_tests/xe_hp_core/xe_hp_sdv/CMakeLists.txt deleted file mode 100644 index 8b8c4b91c8..0000000000 --- a/target_unit_tests/xe_hp_core/xe_hp_sdv/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (C) 2021 Intel Corporation -# -# SPDX-License-Identifier: MIT -# - -if(TESTS_XE_HP_SDV) - include(${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}enable_xe_hp_sdv_testing.cmake) -endif() diff --git a/target_unit_tests/xe_hp_core/xe_hp_sdv/enable_xe_hp_sdv_testing.cmake b/target_unit_tests/xe_hp_core/xe_hp_sdv/enable_xe_hp_sdv_testing.cmake deleted file mode 100644 index be1e6aa779..0000000000 --- a/target_unit_tests/xe_hp_core/xe_hp_sdv/enable_xe_hp_sdv_testing.cmake +++ /dev/null @@ -1,10 +0,0 @@ -# -# Copyright (C) 2021 Intel Corporation -# -# SPDX-License-Identifier: MIT -# - -if(TESTS_XE_HP_SDV) - set(unit_test_config "xe_hp_sdv/2/4/5/4") # non-zero values for unit tests - include(${NEO_SOURCE_DIR}/cmake/run_ult_target.cmake) -endif()