From 51b8dc66a3c2677e6c4c748cca2b37b173c305c8 Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Wed, 12 Apr 2023 14:54:36 +0000 Subject: [PATCH] fix ocloc/ult: set default PVC device to pvc xt C0 ensure default hw ip version matches the value from helper change pvc ult execution to revision 3 Related-To: NEO-7738 Signed-off-by: Mateusz Jablonski --- .../debug/debug_session_thread_tests.cpp | 4 +- .../command_stream_receiver_hw_tests_pvc.cpp | 4 +- shared/source/gen9/hw_info_cfl.cpp | 11 +-- shared/source/gen9/hw_info_kbl.cpp | 11 +-- shared/source/xe_hpc_core/hw_info_pvc.cpp | 13 ++-- shared/test/common/tests_configuration.cpp | 4 + ...t_encode_dispatch_kernel_pvc_and_later.cpp | 37 --------- .../unit_test/helpers/hw_aot_config_tests.cpp | 10 ++- .../pvc/gfx_core_helper_tests_pvc.cpp | 6 +- .../pvc/test_encode_dispatch_kernel_pvc.cpp | 76 ++++++++++++++++++- .../pvc/test_product_helper_pvc.cpp | 1 + .../xe_hpc_core/test_encode_xe_hpc_core.cpp | 36 --------- .../xe_hpc_core/pvc/enable_pvc_testing.cmake | 2 +- 13 files changed, 118 insertions(+), 97 deletions(-) diff --git a/level_zero/tools/test/unit_tests/sources/debug/debug_session_thread_tests.cpp b/level_zero/tools/test/unit_tests/sources/debug/debug_session_thread_tests.cpp index f572baa00e..6e623309cb 100644 --- a/level_zero/tools/test/unit_tests/sources/debug/debug_session_thread_tests.cpp +++ b/level_zero/tools/test/unit_tests/sources/debug/debug_session_thread_tests.cpp @@ -490,8 +490,10 @@ TEST(DebugSession, givenDifferentThreadsWhenGettingPerThreadScratchOffsetThenCor NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); Mock deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); auto debugSession = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp); + auto &productHelper = neoDevice->getProductHelper(); - const uint32_t numThreadsPerEu = (hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount); + const uint32_t multiplyFactor = productHelper.getThreadEuRatioForScratch(hwInfo) / 8u; + const uint32_t numThreadsPerEu = (hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount) * multiplyFactor; EuThread::ThreadId thread0Eu0 = {0, 0, 0, 0, 0}; EuThread::ThreadId thread0Eu1 = {0, 0, 0, 1, 0}; EuThread::ThreadId thread2Subslice1 = {0, 0, 1, 0, 2}; diff --git a/opencl/test/unit_test/xe_hpc_core/pvc/command_stream_receiver_hw_tests_pvc.cpp b/opencl/test/unit_test/xe_hpc_core/pvc/command_stream_receiver_hw_tests_pvc.cpp index 1e5a87e28e..2084636cf9 100644 --- a/opencl/test/unit_test/xe_hpc_core/pvc/command_stream_receiver_hw_tests_pvc.cpp +++ b/opencl/test/unit_test/xe_hpc_core/pvc/command_stream_receiver_hw_tests_pvc.cpp @@ -288,7 +288,7 @@ PVCTEST_F(PvcMultiRootDeviceCommandStreamReceiverBufferTests, givenMultipleEvent csHwParser.parseCommands(pCmdQ1->getCS(0)); auto semaphores = findAll(csHwParser.cmdList.begin(), csHwParser.cmdList.end()); - EXPECT_EQ(3u, semaphores.size()); + EXPECT_EQ(2u, semaphores.size()); auto semaphoreCmd0 = genCmdCast(*(semaphores[0])); EXPECT_EQ(1u, semaphoreCmd0->getSemaphoreDataDword()); @@ -316,7 +316,7 @@ PVCTEST_F(PvcMultiRootDeviceCommandStreamReceiverBufferTests, givenMultipleEvent csHwParser.parseCommands(pCmdQ2->getCS(0)); auto semaphores = findAll(csHwParser.cmdList.begin(), csHwParser.cmdList.end()); - EXPECT_EQ(3u, semaphores.size()); + EXPECT_EQ(2u, semaphores.size()); auto semaphoreCmd0 = genCmdCast(*(semaphores[0])); EXPECT_EQ(1u, semaphoreCmd0->getSemaphoreDataDword()); diff --git a/shared/source/gen9/hw_info_cfl.cpp b/shared/source/gen9/hw_info_cfl.cpp index 27d829d2e0..8e1db4d059 100644 --- a/shared/source/gen9/hw_info_cfl.cpp +++ b/shared/source/gen9/hw_info_cfl.cpp @@ -7,6 +7,7 @@ #include "shared/source/aub_mem_dump/definitions/aub_services.h" #include "shared/source/command_stream/preemption_mode.h" +#include "shared/source/gen9/cfl/device_ids_configs_cfl.h" #include "shared/source/gen9/hw_cmds_cfl.h" #include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" @@ -23,11 +24,11 @@ const PLATFORM CFL::platform = { PCH_UNKNOWN, IGFX_GEN9_CORE, IGFX_GEN9_CORE, - PLATFORM_NONE, // default init - 0, // usDeviceID - 9, // usRevId. 0 sets the stepping to A0 - 0, // usDeviceID_PCH - 0, // usRevId_PCH + PLATFORM_NONE, // default init + cflDeviceIds[0], // usDeviceID + 9, // usRevId. 0 sets the stepping to A0 + 0, // usDeviceID_PCH + 0, // usRevId_PCH GTTYPE_UNDEFINED}; const RuntimeCapabilityTable CFL::capabilityTable{ diff --git a/shared/source/gen9/hw_info_kbl.cpp b/shared/source/gen9/hw_info_kbl.cpp index 15b0d69416..e38b0437c3 100644 --- a/shared/source/gen9/hw_info_kbl.cpp +++ b/shared/source/gen9/hw_info_kbl.cpp @@ -8,6 +8,7 @@ #include "shared/source/aub_mem_dump/definitions/aub_services.h" #include "shared/source/command_stream/preemption_mode.h" #include "shared/source/gen9/hw_cmds_kbl.h" +#include "shared/source/gen9/kbl/device_ids_configs_kbl.h" #include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" @@ -23,11 +24,11 @@ const PLATFORM KBL::platform = { PCH_UNKNOWN, IGFX_GEN9_CORE, IGFX_GEN9_CORE, - PLATFORM_NONE, // default init - 0, // usDeviceID - 9, // usRevId. 0 sets the stepping to A0 - 0, // usDeviceID_PCH - 0, // usRevId_PCH + PLATFORM_NONE, // default init + kblDeviceIds[0], // usDeviceID + 9, // usRevId. 0 sets the stepping to A0 + 0, // usDeviceID_PCH + 0, // usRevId_PCH GTTYPE_UNDEFINED}; const RuntimeCapabilityTable KBL::capabilityTable{ diff --git a/shared/source/xe_hpc_core/hw_info_pvc.cpp b/shared/source/xe_hpc_core/hw_info_pvc.cpp index 02871891b6..3ac085a1ea 100644 --- a/shared/source/xe_hpc_core/hw_info_pvc.cpp +++ b/shared/source/xe_hpc_core/hw_info_pvc.cpp @@ -12,6 +12,7 @@ #include "shared/source/helpers/constants.h" #include "shared/source/unified_memory/usm_memory_support.h" #include "shared/source/xe_hpc_core/hw_cmds_pvc.h" +#include "shared/source/xe_hpc_core/pvc/device_ids_configs_pvc.h" #include "aubstream/engine_node.h" #include "platforms.h" @@ -25,11 +26,11 @@ const PLATFORM PVC::platform = { PCH_UNKNOWN, IGFX_XE_HPC_CORE, IGFX_XE_HPC_CORE, - PLATFORM_NONE, // default init - 0, // usDeviceID - 0, // usRevId. 0 sets the stepping to A0 - 0, // usDeviceID_PCH - 0, // usRevId_PCH + PLATFORM_NONE, // default init + pvcXtDeviceIds[0], // usDeviceID + 7, // usRevId + 0, // usDeviceID_PCH + 0, // usRevId_PCH GTTYPE_UNDEFINED}; const RuntimeCapabilityTable PVC::capabilityTable{ @@ -176,7 +177,7 @@ const HardwareInfo PvcHwConfig::hwInfo = { &PVC::workaroundTable, &PvcHwConfig::gtSystemInfo, PVC::capabilityTable, - AOT::PVC_XT_A0}; + AOT::PVC_XT_C0}; GT_SYSTEM_INFO PvcHwConfig::gtSystemInfo = {0}; void PvcHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { diff --git a/shared/test/common/tests_configuration.cpp b/shared/test/common/tests_configuration.cpp index 713c7b660b..cabe2b68e7 100644 --- a/shared/test/common/tests_configuration.cpp +++ b/shared/test/common/tests_configuration.cpp @@ -9,6 +9,7 @@ #include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/hw_info.h" +#include "shared/source/os_interface/product_helper.h" namespace NEO { @@ -38,5 +39,8 @@ void adjustHwInfoForTests(HardwareInfo &hwInfoForTests, uint32_t euPerSubSlice, gtSystemInfo.MaxEuPerSubSlice = std::max(gtSystemInfo.MaxEuPerSubSlice, euPerSubSlice); gtSystemInfo.MaxSlicesSupported = std::max(gtSystemInfo.MaxSlicesSupported, gtSystemInfo.SliceCount); gtSystemInfo.MaxSubSlicesSupported = std::max(gtSystemInfo.MaxSubSlicesSupported, gtSystemInfo.SubSliceCount); + + auto productHelper = ProductHelper::create(hwInfoForTests.platform.eProductFamily); + hwInfoForTests.ipVersion.value = productHelper->getProductConfigFromHwInfo(hwInfoForTests); } } // namespace NEO diff --git a/shared/test/unit_test/encoders/test_encode_dispatch_kernel_pvc_and_later.cpp b/shared/test/unit_test/encoders/test_encode_dispatch_kernel_pvc_and_later.cpp index 0003561077..a3d6ab07c7 100644 --- a/shared/test/unit_test/encoders/test_encode_dispatch_kernel_pvc_and_later.cpp +++ b/shared/test/unit_test/encoders/test_encode_dispatch_kernel_pvc_and_later.cpp @@ -14,7 +14,6 @@ #include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/test_macros/hw_test.h" #include "shared/test/common/test_macros/test.h" -#include "shared/test/unit_test/encoders/test_encode_dispatch_kernel_dg2_and_later.h" #include "shared/test/unit_test/fixtures/command_container_fixture.h" #include "shared/test/unit_test/mocks/mock_dispatch_kernel_encoder_interface.h" @@ -98,39 +97,3 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTestPvcAndLater, givenCommandCon auto cmd = genCmdCast(*itorCmd); EXPECT_EQ(productHelper.isGrfNumReportedWithScm(), cmd->getLargeGrfMode()); } - -using CommandEncodeStatesTestHpc = Test; -HWTEST2_F(CommandEncodeStatesTestHpc, GivenVariousSlmTotalSizesAndSettingRevIDToDifferentValuesWhenSetAdditionalInfoIsCalledThenCorrectValuesAreSet, IsPVC) { - using PREFERRED_SLM_ALLOCATION_SIZE = typename FamilyType::INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE; - - const std::vector> valuesToTest = { - {0, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_0K}, - {16 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_16K}, - {32 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_32K}, - {64 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_64K}, - {96 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_96K}, - {128 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_128K}, - }; - - const std::vector> valuesToTestForPvcAStep = { - {0, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_16K}, - {16 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_16K}, - {32 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_32K}, - {64 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_64K}, - {96 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_96K}, - {128 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_128K}, - }; - - const std::array revs{REVISION_A0, REVISION_B, REVISION_C, REVISION_D, REVISION_K}; - auto &hwInfo = *pDevice->getRootDeviceEnvironment().getMutableHardwareInfo(); - auto &productHelper = pDevice->getRootDeviceEnvironment().getProductHelper(); - - for (auto rev : revs) { - hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(rev, hwInfo); - if ((hwInfo.platform.eProductFamily == IGFX_PVC) && (rev == REVISION_A0)) { - verifyPreferredSlmValues(valuesToTestForPvcAStep, pDevice->getRootDeviceEnvironment()); - } else { - verifyPreferredSlmValues(valuesToTest, pDevice->getRootDeviceEnvironment()); - } - } -} diff --git a/shared/test/unit_test/helpers/hw_aot_config_tests.cpp b/shared/test/unit_test/helpers/hw_aot_config_tests.cpp index 6fb3c7ae05..6351cd24f6 100644 --- a/shared/test/unit_test/helpers/hw_aot_config_tests.cpp +++ b/shared/test/unit_test/helpers/hw_aot_config_tests.cpp @@ -41,4 +41,12 @@ HWTEST2_P(ProductConfigHwInfoTests, givenAotConfigWhenGetProductConfigThenCorrec hwInfo.ipVersion.revision = aotConfig.revision; auto ret = productHelper->getProductConfigFromHwInfo(hwInfo); EXPECT_EQ(ret, productConfig); -} \ No newline at end of file +} + +TEST(ProductConfigHwInfoTest, givenDefaultAotConfigWhenGetProductConfigThenSameValueIsReturned) { + MockExecutionEnvironment mockExecutionEnvironment{}; + auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); + auto hwInfo = *defaultHwInfo; + auto ret = productHelper.getProductConfigFromHwInfo(hwInfo); + EXPECT_EQ(ret, hwInfo.ipVersion.value); +} diff --git a/shared/test/unit_test/xe_hpc_core/pvc/gfx_core_helper_tests_pvc.cpp b/shared/test/unit_test/xe_hpc_core/pvc/gfx_core_helper_tests_pvc.cpp index 39271c0b1e..0aa61ff171 100644 --- a/shared/test/unit_test/xe_hpc_core/pvc/gfx_core_helper_tests_pvc.cpp +++ b/shared/test/unit_test/xe_hpc_core/pvc/gfx_core_helper_tests_pvc.cpp @@ -8,6 +8,7 @@ #include "shared/source/command_container/command_encoder.h" #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/xe_hpc_core/hw_cmds_pvc.h" +#include "shared/source/xe_hpc_core/pvc/device_ids_configs_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/gfx_core_helper_tests.h" @@ -33,6 +34,7 @@ PVCTEST_F(GfxCoreHelperTestsPvc, givenRevisionEnumAndPlatformFamilyTypeThenPrope const auto &productHelper = getHelper(); for (auto stepping : steppings) { + hardwareInfo.platform.usDeviceID = pvcXlDeviceIds[0]; hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(stepping, hardwareInfo); if (stepping == REVISION_A0) { @@ -61,14 +63,14 @@ PVCTEST_F(GfxCoreHelperTestsPvc, givenRevisionEnumAndPlatformFamilyTypeThenPrope } PVCTEST_F(GfxCoreHelperTestsPvc, givenDefaultMemorySynchronizationCommandsWhenGettingSizeForAdditionalSynchronizationThenCorrectValueIsReturned) { - EXPECT_EQ(NEO::EncodeSemaphore::getSizeMiSemaphoreWait(), MemorySynchronizationCommands::getSizeForAdditonalSynchronization(pDevice->getRootDeviceEnvironment())); + EXPECT_EQ(sizeof(typename FamilyType::MI_MEM_FENCE), MemorySynchronizationCommands::getSizeForAdditonalSynchronization(pDevice->getRootDeviceEnvironment())); } PVCTEST_F(GfxCoreHelperTestsPvc, givenDebugMemorySynchronizationCommandsWhenGettingSizeForAdditionalSynchronizationThenCorrectValueIsReturned) { DebugManagerStateRestore restorer; DebugManager.flags.DisablePipeControlPrecedingPostSyncCommand.set(1); - EXPECT_EQ(2 * NEO::EncodeSemaphore::getSizeMiSemaphoreWait(), MemorySynchronizationCommands::getSizeForAdditonalSynchronization(pDevice->getRootDeviceEnvironment())); + EXPECT_EQ(2 * sizeof(typename FamilyType::MI_MEM_FENCE), MemorySynchronizationCommands::getSizeForAdditonalSynchronization(pDevice->getRootDeviceEnvironment())); } PVCTEST_F(GfxCoreHelperTestsPvc, givenRevisionIdWhenGetComputeUnitsUsedForScratchThenReturnValidValue) { diff --git a/shared/test/unit_test/xe_hpc_core/pvc/test_encode_dispatch_kernel_pvc.cpp b/shared/test/unit_test/xe_hpc_core/pvc/test_encode_dispatch_kernel_pvc.cpp index 408b62af96..122ef37d7e 100644 --- a/shared/test/unit_test/xe_hpc_core/pvc/test_encode_dispatch_kernel_pvc.cpp +++ b/shared/test/unit_test/xe_hpc_core/pvc/test_encode_dispatch_kernel_pvc.cpp @@ -9,11 +9,13 @@ #include "shared/source/xe_hpc_core/hw_cmds_pvc.h" #include "shared/source/xe_hpc_core/pvc/device_ids_configs_pvc.h" #include "shared/test/common/cmd_parse/gen_cmd_parse.h" +#include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/mocks/mock_device.h" #include "shared/test/common/mocks/mock_execution_environment.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/encoders/test_encode_dispatch_kernel_dg2_and_later.h" #include "shared/test/unit_test/fixtures/command_container_fixture.h" #include "shared/test/unit_test/mocks/mock_dispatch_kernel_encoder_interface.h" @@ -132,4 +134,76 @@ PVCTEST_F(EncodeKernelPvcTest, givenRevisionBAndAboveWhenSpecialModeRequiredAndA cmdContainer->reset(); } } -} \ No newline at end of file +} +using CommandEncodeStatesTestPvc = Test; +PVCTEST_F(CommandEncodeStatesTestPvc, GivenVariousSlmTotalSizesAndSettingRevIDToDifferentValuesWhenSetAdditionalInfoIsCalledThenCorrectValuesAreSet) { + using PREFERRED_SLM_ALLOCATION_SIZE = typename FamilyType::INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE; + + const std::vector> valuesToTest = { + {0, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_0K}, + {16 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_16K}, + {32 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_32K}, + {64 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_64K}, + {96 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_96K}, + {128 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_128K}, + }; + + const std::vector> valuesToTestForPvcAStep = { + {0, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_16K}, + {16 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_16K}, + {32 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_32K}, + {64 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_64K}, + {96 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_96K}, + {128 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_128K}, + }; + + const std::array revs{REVISION_A0, REVISION_B, REVISION_C, REVISION_D, REVISION_K}; + auto &hwInfo = *pDevice->getRootDeviceEnvironment().getMutableHardwareInfo(); + auto &productHelper = pDevice->getRootDeviceEnvironment().getProductHelper(); + + hwInfo.platform.usDeviceID = pvcXlDeviceIds[0]; + for (auto rev : revs) { + hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(rev, hwInfo); + if ((hwInfo.platform.eProductFamily == IGFX_PVC) && (rev == REVISION_A0)) { + verifyPreferredSlmValues(valuesToTestForPvcAStep, pDevice->getRootDeviceEnvironment()); + } else { + verifyPreferredSlmValues(valuesToTest, pDevice->getRootDeviceEnvironment()); + } + } +} + +PVCTEST_F(EncodeKernelPvcTest, givenDefaultSettingForFenceAsPostSyncOperationInComputeWalkerWhenEnqueueKernelIsCalledThenDoNotGenerateFenceCommands) { + using WALKER_TYPE = typename FamilyType::WALKER_TYPE; + using MI_MEM_FENCE = typename FamilyType::MI_MEM_FENCE; + + DebugManagerStateRestore restore; + DebugManager.flags.ProgramGlobalFenceAsPostSyncOperationInComputeWalker.set(-1); + + auto &hwInfo = *pDevice->getRootDeviceEnvironment().getMutableHardwareInfo(); + auto &productHelper = pDevice->getProductHelper(); + + hwInfo.platform.usDeviceID = pvcXlDeviceIds[0]; + VariableBackup hwRevId{&hwInfo.platform.usRevId}; + hwRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hwInfo); + + uint32_t dims[] = {1, 1, 1}; + std::unique_ptr dispatchInterface(new MockDispatchKernelEncoder()); + dispatchInterface->getCrossThreadDataSizeResult = 0u; + + bool requiresUncachedMocs = false; + EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); + dispatchArgs.isKernelUsingSystemAllocation = true; + dispatchArgs.isHostScopeSignalEvent = true; + + EncodeDispatchKernel::encode(*cmdContainer.get(), dispatchArgs, nullptr); + + GenCmdList commands; + CmdParse::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); + + auto itor = find(commands.begin(), commands.end()); + ASSERT_NE(itor, commands.end()); + + auto walkerCmd = genCmdCast(*itor); + auto &postSyncData = walkerCmd->getPostSync(); + EXPECT_FALSE(postSyncData.getSystemMemoryFenceRequest()); +} diff --git a/shared/test/unit_test/xe_hpc_core/pvc/test_product_helper_pvc.cpp b/shared/test/unit_test/xe_hpc_core/pvc/test_product_helper_pvc.cpp index 337e0d95f7..f36d5ac032 100644 --- a/shared/test/unit_test/xe_hpc_core/pvc/test_product_helper_pvc.cpp +++ b/shared/test/unit_test/xe_hpc_core/pvc/test_product_helper_pvc.cpp @@ -49,6 +49,7 @@ PVCTEST_F(PvcProductHelper, givenPVCRevId0WhenGettingThreadEuRatioForScratchThen PVCTEST_F(PvcProductHelper, givenPVCWithDifferentSteppingsThenImplicitScalingIsEnabledForBAndHigher) { auto hwInfo = *defaultHwInfo; + hwInfo.platform.usDeviceID = pvcXlDeviceIds[0]; for (uint32_t stepping = 0; stepping < 0x10; stepping++) { auto hwRevIdFromStepping = productHelper->getHwRevIdFromStepping(stepping, hwInfo); diff --git a/shared/test/unit_test/xe_hpc_core/test_encode_xe_hpc_core.cpp b/shared/test/unit_test/xe_hpc_core/test_encode_xe_hpc_core.cpp index f1077c235c..40f29b320c 100644 --- a/shared/test/unit_test/xe_hpc_core/test_encode_xe_hpc_core.cpp +++ b/shared/test/unit_test/xe_hpc_core/test_encode_xe_hpc_core.cpp @@ -14,7 +14,6 @@ #include "shared/source/kernel/kernel_descriptor.h" #include "shared/source/os_interface/product_helper.h" #include "shared/test/common/cmd_parse/gen_cmd_parse.h" -#include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/mocks/mock_device.h" #include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" @@ -360,41 +359,6 @@ XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenFenceAsPostSyncOperationInComp EXPECT_TRUE(postSyncData.getSystemMemoryFenceRequest()); } -XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenDefaultSettingForFenceAsPostSyncOperationInComputeWalkerWhenEnqueueKernelIsCalledThenDoNotGenerateFenceCommands) { - using WALKER_TYPE = typename FamilyType::WALKER_TYPE; - using MI_MEM_FENCE = typename FamilyType::MI_MEM_FENCE; - - DebugManagerStateRestore restore; - DebugManager.flags.ProgramGlobalFenceAsPostSyncOperationInComputeWalker.set(-1); - - auto &hwInfo = *pDevice->getRootDeviceEnvironment().getMutableHardwareInfo(); - auto &productHelper = pDevice->getProductHelper(); - - VariableBackup hwRevId{&hwInfo.platform.usRevId}; - hwRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hwInfo); - - uint32_t dims[] = {1, 1, 1}; - std::unique_ptr dispatchInterface(new MockDispatchKernelEncoder()); - dispatchInterface->getCrossThreadDataSizeResult = 0u; - - bool requiresUncachedMocs = false; - EncodeDispatchKernelArgs dispatchArgs = createDefaultDispatchKernelArgs(pDevice, dispatchInterface.get(), dims, requiresUncachedMocs); - dispatchArgs.isKernelUsingSystemAllocation = true; - dispatchArgs.isHostScopeSignalEvent = true; - - EncodeDispatchKernel::encode(*cmdContainer.get(), dispatchArgs, nullptr); - - GenCmdList commands; - CmdParse::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); - - auto itor = find(commands.begin(), commands.end()); - ASSERT_NE(itor, commands.end()); - - auto walkerCmd = genCmdCast(*itor); - auto &postSyncData = walkerCmd->getPostSync(); - EXPECT_FALSE(postSyncData.getSystemMemoryFenceRequest()); -} - XE_HPC_CORETEST_F(EncodeKernelXeHpcCoreTest, givenDefaultSettingForFenceWhenKernelUsesSystemMemoryFlagTrueAndNoHostSignalEventThenNotUseSystemFence) { using WALKER_TYPE = typename FamilyType::WALKER_TYPE; diff --git a/target_unit_tests/xe_hpc_core/pvc/enable_pvc_testing.cmake b/target_unit_tests/xe_hpc_core/pvc/enable_pvc_testing.cmake index 0e588ed508..308add06fa 100644 --- a/target_unit_tests/xe_hpc_core/pvc/enable_pvc_testing.cmake +++ b/target_unit_tests/xe_hpc_core/pvc/enable_pvc_testing.cmake @@ -5,6 +5,6 @@ # if(TESTS_PVC) - set(unit_test_config "pvc/2/4/5/0") # non-zero values for unit tests + set(unit_test_config "pvc/2/4/5/3") # non-zero values for unit tests include(${NEO_SOURCE_DIR}/cmake/run_ult_target.cmake) endif()