diff --git a/opencl/test/unit_test/xe_hpc_core/pvc/CMakeLists.txt b/opencl/test/unit_test/xe_hpc_core/pvc/CMakeLists.txt index 9826492f28..71d9013c18 100644 --- a/opencl/test/unit_test/xe_hpc_core/pvc/CMakeLists.txt +++ b/opencl/test/unit_test/xe_hpc_core/pvc/CMakeLists.txt @@ -7,11 +7,11 @@ if(TESTS_PVC) set(IGDRCL_SRCS_tests_xe_hpc_core_pvc ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/cl_hw_helper_tests_pvc.cpp ${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_hw_tests_pvc.cpp ${CMAKE_CURRENT_SOURCE_DIR}/engine_node_helper_tests_pvc.cpp ${CMAKE_CURRENT_SOURCE_DIR}/get_device_info_pvc.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_pvc.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/hw_helper_tests_pvc.cpp ) target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_xe_hpc_core_pvc}) add_subdirectories() diff --git a/opencl/test/unit_test/xe_hpc_core/pvc/cl_hw_helper_tests_pvc.cpp b/opencl/test/unit_test/xe_hpc_core/pvc/cl_hw_helper_tests_pvc.cpp new file mode 100644 index 0000000000..b9d3dc8a0a --- /dev/null +++ b/opencl/test/unit_test/xe_hpc_core/pvc/cl_hw_helper_tests_pvc.cpp @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2022 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/xe_hpc_core/hw_cmds_pvc.h" +#include "shared/test/common/helpers/ult_hw_config.h" +#include "shared/test/common/test_macros/header/per_product_test_definitions.h" +#include "shared/test/common/test_macros/test.h" + +#include "opencl/test/unit_test/xe_hpc_core/xe_hpc_core_test_ocl_fixtures.h" + +namespace NEO { + +using ClHwHelperTestsPvcXt = Test; + +PVCTEST_F(ClHwHelperTestsPvcXt, givenSingleTileCsrOnPvcXtWhenAllocatingCsrSpecificAllocationsAndIsNotBaseDieA0ThenStoredInProperMemoryPool) { + auto hwInfo = *defaultHwInfo; + const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); + hwInfo.platform.usDeviceID = pvcXtDeviceIds.front(); + hwInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_B, hwInfo); // not BD A0 + checkIfSingleTileCsrWhenAllocatingCsrSpecificAllocationsThenStoredInProperMemoryPool(&hwInfo); +} + +PVCTEST_F(ClHwHelperTestsPvcXt, givenMultiTileCsrOnPvcWhenAllocatingCsrSpecificAllocationsAndIsNotBaseDieA0ThenStoredInLocalMemoryPool) { + auto hwInfo = *defaultHwInfo; + const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); + hwInfo.platform.usDeviceID = pvcXtDeviceIds.front(); + hwInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_B, hwInfo); // not BD A0 + checkIfMultiTileCsrWhenAllocatingCsrSpecificAllocationsThenStoredInLocalMemoryPool(&hwInfo); +} +} // namespace NEO diff --git a/opencl/test/unit_test/xe_hpc_core/xe_hpc_core_test_ocl_fixtures.cpp b/opencl/test/unit_test/xe_hpc_core/xe_hpc_core_test_ocl_fixtures.cpp index dce50f829c..3ec5587a7e 100644 --- a/opencl/test/unit_test/xe_hpc_core/xe_hpc_core_test_ocl_fixtures.cpp +++ b/opencl/test/unit_test/xe_hpc_core/xe_hpc_core_test_ocl_fixtures.cpp @@ -15,12 +15,12 @@ namespace NEO { -void HwHelperTestsXeHpcCore::setupDeviceIdAndRevision(HardwareInfo *hwInfo, ClDevice &clDevice) { +void ClHwHelperXeHpcCoreFixture::setupDeviceIdAndRevision(HardwareInfo *hwInfo, ClDevice &clDevice) { auto deviceHwInfo = clDevice.getExecutionEnvironment()->rootDeviceEnvironments[0]->getMutableHardwareInfo(); deviceHwInfo->platform.usDeviceID = hwInfo->platform.usDeviceID; deviceHwInfo->platform.usRevId = hwInfo->platform.usRevId; } -void HwHelperTestsXeHpcCore::checkIfSingleTileCsrWhenAllocatingCsrSpecificAllocationsThenStoredInProperMemoryPool(HardwareInfo *hwInfo) { +void ClHwHelperXeHpcCoreFixture::checkIfSingleTileCsrWhenAllocatingCsrSpecificAllocationsThenStoredInProperMemoryPool(HardwareInfo *hwInfo) { const uint32_t numDevices = 4u; const uint32_t tileIndex = 2u; const DeviceBitfield singleTileMask{static_cast(1u << tileIndex)}; @@ -48,7 +48,7 @@ void HwHelperTestsXeHpcCore::checkIfSingleTileCsrWhenAllocatingCsrSpecificAlloca EXPECT_EQ(commandBufferAllocation->getMemoryPool(), MemoryPool::LocalMemory); } -void HwHelperTestsXeHpcCore::checkIfMultiTileCsrWhenAllocatingCsrSpecificAllocationsThenStoredInLocalMemoryPool(HardwareInfo *hwInfo) { +void ClHwHelperXeHpcCoreFixture::checkIfMultiTileCsrWhenAllocatingCsrSpecificAllocationsThenStoredInLocalMemoryPool(HardwareInfo *hwInfo) { const uint32_t numDevices = 4u; const DeviceBitfield tile0Mask{0x1}; ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false; diff --git a/opencl/test/unit_test/xe_hpc_core/xe_hpc_core_test_ocl_fixtures.h b/opencl/test/unit_test/xe_hpc_core/xe_hpc_core_test_ocl_fixtures.h index 26950fae29..f3f838d165 100644 --- a/opencl/test/unit_test/xe_hpc_core/xe_hpc_core_test_ocl_fixtures.h +++ b/opencl/test/unit_test/xe_hpc_core/xe_hpc_core_test_ocl_fixtures.h @@ -13,7 +13,7 @@ #include "opencl/test/unit_test/fixtures/cl_device_fixture.h" namespace NEO { -struct HwHelperTestsXeHpcCore : public ClDeviceFixture { +struct ClHwHelperXeHpcCoreFixture : public ClDeviceFixture { void checkIfSingleTileCsrWhenAllocatingCsrSpecificAllocationsThenStoredInProperMemoryPool(HardwareInfo *hwInfo); void checkIfMultiTileCsrWhenAllocatingCsrSpecificAllocationsThenStoredInLocalMemoryPool(HardwareInfo *hwInfo); void setupDeviceIdAndRevision(HardwareInfo *hwInfo, ClDevice &clDevice); diff --git a/shared/source/xe_hp_core/hw_info_xe_hp_sdv.cpp b/shared/source/xe_hp_core/hw_info_xe_hp_sdv.cpp index 55f890612e..bd9f385684 100644 --- a/shared/source/xe_hp_core/hw_info_xe_hp_sdv.cpp +++ b/shared/source/xe_hp_core/hw_info_xe_hp_sdv.cpp @@ -6,6 +6,7 @@ */ #include "shared/source/aub_mem_dump/definitions/aub_services.h" +#include "shared/source/command_stream/preemption_mode.h" #include "shared/source/debug_settings/debug_settings_manager.h" #include "shared/source/helpers/constants.h" #include "shared/source/xe_hp_core/hw_cmds.h" diff --git a/shared/test/unit_test/xe_hp_core/test_hw_info_config_xe_hp_core.cpp b/shared/test/unit_test/xe_hp_core/test_hw_info_config_xe_hp_core.cpp index aa421fc95f..8b3aeeb799 100644 --- a/shared/test/unit_test/xe_hp_core/test_hw_info_config_xe_hp_core.cpp +++ b/shared/test/unit_test/xe_hp_core/test_hw_info_config_xe_hp_core.cpp @@ -144,5 +144,5 @@ XEHPTEST_F(XeHpProductHelper, givenProductHelperWhenIsSystolicModeConfigurabledT } XEHPTEST_F(XeHpProductHelper, whenGettingDefaultRevisionThenB0IsReturned) { - EXPECT_EQ(productHelper->getHwRevIdFromStepping(REVISION_B, *defaultHwInfo), productHelper->getDefaultRevisionId(*defaultHwInfo)); + EXPECT_EQ(productHelper->getHwRevIdFromStepping(REVISION_B, *defaultHwInfo), productHelper->getDefaultRevisionId()); } diff --git a/shared/test/unit_test/xe_hpc_core/pvc/CMakeLists.txt b/shared/test/unit_test/xe_hpc_core/pvc/CMakeLists.txt index 1181686cfa..44cddacdf2 100644 --- a/shared/test/unit_test/xe_hpc_core/pvc/CMakeLists.txt +++ b/shared/test/unit_test/xe_hpc_core/pvc/CMakeLists.txt @@ -11,6 +11,7 @@ if(TESTS_PVC) ${CMAKE_CURRENT_SOURCE_DIR}/device_tests_pvc.cpp ${CMAKE_CURRENT_SOURCE_DIR}/dispatch_walker_tests_pvc.cpp ${CMAKE_CURRENT_SOURCE_DIR}/excludes_xe_hpc_core_pvc.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/hw_helper_tests_pvc.cpp ${CMAKE_CURRENT_SOURCE_DIR}/hw_info_tests_pvc.cpp ${CMAKE_CURRENT_SOURCE_DIR}/product_config_helper_tests_pvc.cpp ${CMAKE_CURRENT_SOURCE_DIR}/product_config_tests_pvc.cpp diff --git a/opencl/test/unit_test/xe_hpc_core/pvc/hw_helper_tests_pvc.cpp b/shared/test/unit_test/xe_hpc_core/pvc/hw_helper_tests_pvc.cpp similarity index 82% rename from opencl/test/unit_test/xe_hpc_core/pvc/hw_helper_tests_pvc.cpp rename to shared/test/unit_test/xe_hpc_core/pvc/hw_helper_tests_pvc.cpp index 87e6e06e01..81bbc76057 100644 --- a/opencl/test/unit_test/xe_hpc_core/pvc/hw_helper_tests_pvc.cpp +++ b/shared/test/unit_test/xe_hpc_core/pvc/hw_helper_tests_pvc.cpp @@ -5,36 +5,19 @@ * */ +#include "shared/source/helpers/hw_helper.h" #include "shared/source/xe_hpc_core/hw_cmds_pvc.h" #include "shared/test/common/cmd_parse/hw_parse.h" +#include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/test/common/helpers/hw_helper_tests.h" #include "shared/test/common/helpers/ult_hw_config.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/common/test_macros/test.h" -#include "opencl/test/unit_test/mocks/mock_platform.h" -#include "opencl/test/unit_test/xe_hpc_core/xe_hpc_core_test_ocl_fixtures.h" - namespace NEO { -using HwHelperTestsPvcXt = Test; +using HwHelperTestsPvc = HwHelperTest; -PVCTEST_F(HwHelperTestsPvcXt, givenSingleTileCsrOnPvcXtWhenAllocatingCsrSpecificAllocationsAndIsNotBaseDieA0ThenStoredInProperMemoryPool) { - auto hwInfo = *defaultHwInfo; - const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); - hwInfo.platform.usDeviceID = pvcXtDeviceIds.front(); - hwInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_B, hwInfo); // not BD A0 - checkIfSingleTileCsrWhenAllocatingCsrSpecificAllocationsThenStoredInProperMemoryPool(&hwInfo); -} - -PVCTEST_F(HwHelperTestsPvcXt, givenMultiTileCsrOnPvcWhenAllocatingCsrSpecificAllocationsAndIsNotBaseDieA0ThenStoredInLocalMemoryPool) { - auto hwInfo = *defaultHwInfo; - const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); - hwInfo.platform.usDeviceID = pvcXtDeviceIds.front(); - hwInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_B, hwInfo); // not BD A0 - checkIfMultiTileCsrWhenAllocatingCsrSpecificAllocationsThenStoredInLocalMemoryPool(&hwInfo); -} - -using HwHelperTestsPvc = Test; PVCTEST_F(HwHelperTestsPvc, givenRevisionEnumAndPlatformFamilyTypeThenProperValueForIsWorkaroundRequiredIsReturned) { uint32_t steppings[] = { REVISION_A0, @@ -114,7 +97,7 @@ PVCTEST_F(HwHelperTestsPvc, givenRevisionIdWhenGetComputeUnitsUsedForScratchThen } } -PVCTEST_F(HwHelperTestsPvcXt, givenMemorySynchronizationCommandsWhenAddingSynchronizationThenCorrectMethodIsUsed) { +PVCTEST_F(HwHelperTestsPvc, givenMemorySynchronizationCommandsWhenAddingSynchronizationThenCorrectMethodIsUsed) { using MI_MEM_FENCE = typename FamilyType::MI_MEM_FENCE; using MI_SEMAPHORE_WAIT = typename FamilyType::MI_SEMAPHORE_WAIT;