From 89c3aab321c2eb8c074b9adaf587a90de8e44a2e Mon Sep 17 00:00:00 2001 From: "Vysochyn, Illia" Date: Tue, 19 Nov 2024 17:41:53 +0000 Subject: [PATCH] refactor: Extract PostSyncType to outer abstract layer This modification serves to simplify the integration of generated compute walker structures. Related-To: NEO-13147 Signed-off-by: Vysochyn, Illia --- .../test_cmdlist_append_launch_kernel_2.cpp | 2 +- ...test_cmdlist_copy_event_xehp_and_later.cpp | 16 +++++++-------- ...test_cmdlist_fill_event_xehp_and_later.cpp | 14 ++++++------- .../cmdlist/test_cmdlist_xehp_and_later.cpp | 6 +++--- .../cmdlist/test_in_order_cmdlist_1.cpp | 2 +- .../gpgpu_walker_xehp_and_later.inl | 2 +- ..._walker_partition_tests_xehp_and_later.cpp | 4 ++-- .../dispatch_walker_tests_dg2_and_later.cpp | 2 +- .../dispatch_walker_tests_xehp_and_later.cpp | 6 +++--- ...d_encoder_from_xe_hpg_core_to_xe3_core.inl | 2 +- .../command_encoder_xehp_and_later.inl | 6 +++--- .../hw_cmds_generated_xe2_hpg_core.inl | 2 -- .../xe3_core/hw_cmds_generated_xe3_core.inl | 1 - .../hw_cmds_generated_xe_hpc_core.inl | 2 -- .../hw_cmds_generated_xe_hpg_core.inl | 2 -- shared/source/xe2_hpg_core/hw_cmds_base.h | 6 ++++++ shared/source/xe3_core/hw_cmds_base.h | 5 +++++ .../xe_hpc_core/hw_cmds_xe_hpc_core_base.h | 6 ++++++ .../xe_hpg_core/hw_cmds_xe_hpg_core_base.h | 6 ++++++ ..._encode_dispatch_kernel_xehp_and_later.cpp | 6 +++--- .../test_implicit_scaling_xehp_and_later.cpp | 20 +++++++++---------- .../walker_partition_fixture_xehp_and_later.h | 2 +- ...alker_partition_tests_xehp_and_later_1.cpp | 4 ++-- ...alker_partition_tests_xehp_and_later_2.cpp | 6 +++--- .../xe_hpg_core/hw_cmds_xe_hpg_core_tests.cpp | 8 +++++++- 25 files changed, 80 insertions(+), 58 deletions(-) diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_2.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_2.cpp index 02952d0e35..6731d70085 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_2.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_2.cpp @@ -1440,7 +1440,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, MultiTileCommandListAppendLaunchKernelXeHpCoreTest, std::visit([](auto &&walker) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); EXPECT_TRUE(walker->getWorkloadPartitionEnable()); auto &postSync = walker->getPostSync(); diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_copy_event_xehp_and_later.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_copy_event_xehp_and_later.cpp index cd1a6a6721..3d8c8dad80 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_copy_event_xehp_and_later.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_copy_event_xehp_and_later.cpp @@ -141,7 +141,7 @@ void testSingleTileAppendMemoryCopyThreeKernels(CopyTestInput &input, TestExpect WalkerVariant walkerVariant = NEO::UnitTestHelper::getWalkerVariant(*walker); std::visit([&arg, &kernelEventAddresses, i](auto &&walker) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using OPERATION = typename PostSyncType::OPERATION; auto &postSync = walker->getPostSync(); @@ -231,7 +231,7 @@ void testSingleTileAppendMemoryCopyThreeKernelsAndL3Flush(CopyTestInput &input, WalkerVariant walkerVariant = NEO::UnitTestHelper::getWalkerVariant(*walker); std::visit([&arg, &kernelEventAddresses, i](auto &&walker) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using OPERATION = typename PostSyncType::OPERATION; auto &postSync = walker->getPostSync(); @@ -333,7 +333,7 @@ void testSingleTileAppendMemoryCopySingleKernel(CopyTestInput &input, TestExpect WalkerVariant walkerVariant = NEO::UnitTestHelper::getWalkerVariant(*firstWalker); std::visit([&arg, firstKernelEventAddress](auto &&walker) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using OPERATION = typename PostSyncType::OPERATION; auto &postSync = walker->getPostSync(); @@ -413,7 +413,7 @@ void testSingleTileAppendMemoryCopySingleKernelAndL3Flush(CopyTestInput &input, WalkerVariant walkerVariant = NEO::UnitTestHelper::getWalkerVariant(*firstWalker); std::visit([&arg, firstKernelEventAddress](auto &&walker) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using OPERATION = typename PostSyncType::OPERATION; auto &postSync = walker->getPostSync(); @@ -579,7 +579,7 @@ void testMultiTileAppendMemoryCopyThreeKernels(CopyTestInput &input, TestExpecte std::visit([&arg, i, expectedKernelEventAddress = expectedKernelEventAddress](auto &&walker) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using OPERATION = typename PostSyncType::OPERATION; auto &postSync = walker->getPostSync(); @@ -680,7 +680,7 @@ void testMultiTileAppendMemoryCopyThreeKernelsAndL3Flush(CopyTestInput &input, T std::visit([&arg, i, expectedKernelEventAddress = expectedKernelEventAddress](auto &&walker) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using OPERATION = typename PostSyncType::OPERATION; auto &postSync = walker->getPostSync(); @@ -794,7 +794,7 @@ void testMultiTileAppendMemoryCopySingleKernel(CopyTestInput &input, TestExpecte WalkerVariant walkerVariant = NEO::UnitTestHelper::getWalkerVariant(*firstWalker); std::visit([&arg, firstKernelEventAddress](auto &&walker) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using OPERATION = typename PostSyncType::OPERATION; auto &postSync = walker->getPostSync(); @@ -882,7 +882,7 @@ void testMultiTileAppendMemoryCopySingleKernelAndL3Flush(CopyTestInput &input, T WalkerVariant walkerVariant = NEO::UnitTestHelper::getWalkerVariant(*firstWalker); std::visit([&arg, firstKernelEventAddress](auto &&walker) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using OPERATION = typename PostSyncType::OPERATION; auto &postSync = walker->getPostSync(); diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_fill_event_xehp_and_later.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_fill_event_xehp_and_later.cpp index d9d2d4bfbd..5ed00969be 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_fill_event_xehp_and_later.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_fill_event_xehp_and_later.cpp @@ -135,7 +135,7 @@ void testSingleTileAppendMemoryFillManyImmediateKernels(FillTestInput &input, Te std::visit([expectedKernelEventAddress = expectedKernelEventAddress, &arg, i](auto &&walker) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using OPERATION = typename PostSyncType::OPERATION; auto &postSync = walker->getPostSync(); @@ -221,7 +221,7 @@ void testSingleTileAppendMemoryFillManyKernels(FillTestInput &input, TestExpecte std::visit([expectedKernelEventAddress = expectedKernelEventAddress, &arg, i](auto &&walker) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using OPERATION = typename PostSyncType::OPERATION; auto &postSync = walker->getPostSync(); @@ -308,7 +308,7 @@ void testSingleTileAppendMemoryFillManyKernelsAndL3Flush(FillTestInput &input, T std::visit([expectedKernelEventAddress = expectedKernelEventAddress, &arg, i](auto &&walker) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using OPERATION = typename PostSyncType::OPERATION; auto &postSync = walker->getPostSync(); @@ -391,7 +391,7 @@ void testSingleTileAppendMemoryFillSingleKernel(FillTestInput &input, TestExpect WalkerVariant walkerVariant = NEO::UnitTestHelper::getWalkerVariant(*firstWalker); std::visit([&arg, firstKernelEventAddress](auto &&walker) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using OPERATION = typename PostSyncType::OPERATION; auto &postSync = walker->getPostSync(); @@ -476,7 +476,7 @@ void testSingleTileAppendMemoryFillSingleKernelAndL3Flush(FillTestInput &input, WalkerVariant walkerVariant = NEO::UnitTestHelper::getWalkerVariant(*firstWalker); std::visit([&arg, firstKernelEventAddress](auto &&walker) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using OPERATION = typename PostSyncType::OPERATION; auto &postSync = walker->getPostSync(); @@ -599,7 +599,7 @@ void testMultiTileAppendMemoryFillManyKernels(FillTestInput &input, TestExpected std::visit([expectedKernelEventAddress = expectedKernelEventAddress, &arg, i](auto &&walker) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using OPERATION = typename PostSyncType::OPERATION; auto &postSync = walker->getPostSync(); @@ -709,7 +709,7 @@ void testMultiTileAppendMemoryFillSingleKernelAndL3Flush(FillTestInput &input, T WalkerVariant walkerVariant = NEO::UnitTestHelper::getWalkerVariant(*firstWalker); std::visit([&arg, firstKernelEventAddress](auto &&walker) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using OPERATION = typename PostSyncType::OPERATION; auto &postSync = walker->getPostSync(); diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_xehp_and_later.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_xehp_and_later.cpp index 60e5fa77df..d38aa34797 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_xehp_and_later.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_xehp_and_later.cpp @@ -412,7 +412,7 @@ struct CommandListAppendLaunchKernelCompactL3FlushEventFixture : public ModuleFi WalkerVariant walkerVariant = NEO::UnitTestHelper::getWalkerVariant(*firstWalker); std::visit([&arg, firstKernelEventAddress](auto &&walker) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using OPERATION = typename PostSyncType::OPERATION; auto &postSync = walker->getPostSync(); @@ -667,7 +667,7 @@ struct CommandListSignalAllEventPacketFixture : public ModuleFixture { WalkerVariant walkerVariant = NEO::UnitTestHelper::getWalkerVariant(*firstWalker); std::visit([expectedWalkerPostSyncOp](auto &&walker) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using OPERATION = typename PostSyncType::OPERATION; auto &postSync = walker->getPostSync(); @@ -3132,7 +3132,7 @@ HWTEST2_F(CommandListAppendLaunchKernel, WalkerVariant walkerVariant = NEO::UnitTestHelper::getWalkerVariant(launchParams.cmdWalkerBuffer); std::visit([eventBaseAddress](auto &&walker) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); auto &postSync = walker->getPostSync(); EXPECT_NE(eventBaseAddress, postSync.getDestinationAddress()); diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_1.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_1.cpp index de8427b2c5..5023004006 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_1.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_1.cpp @@ -3381,7 +3381,7 @@ HWTEST2_F(InOrderCmdListTests, givenInOrderModeWhenProgrammingKernelSplitThenDon std::visit([](auto &&walker) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); auto &postSync = walker->getPostSync(); EXPECT_EQ(PostSyncType::OPERATION_NO_WRITE, postSync.getOperation()); diff --git a/opencl/source/command_queue/gpgpu_walker_xehp_and_later.inl b/opencl/source/command_queue/gpgpu_walker_xehp_and_later.inl index 586f0068a3..882f6290e0 100644 --- a/opencl/source/command_queue/gpgpu_walker_xehp_and_later.inl +++ b/opencl/source/command_queue/gpgpu_walker_xehp_and_later.inl @@ -101,7 +101,7 @@ void GpgpuWalkerHelper::setupTimestampPacket(LinearStream *cmdStream, WalkerType *walkerCmd, TagNodeBase *timestampPacketNode, const RootDeviceEnvironment &rootDeviceEnvironment) { - using POSTSYNC_DATA = typename WalkerType::PostSyncType; + using POSTSYNC_DATA = decltype(GfxFamily::template getPostSyncType()); auto &postSyncData = walkerCmd->getPostSync(); postSyncData.setDataportPipelineFlush(true); diff --git a/opencl/test/unit_test/aub_tests/command_stream/aub_walker_partition_tests_xehp_and_later.cpp b/opencl/test/unit_test/aub_tests/command_stream/aub_walker_partition_tests_xehp_and_later.cpp index b22cb2ba6c..ad2980a3c8 100644 --- a/opencl/test/unit_test/aub_tests/command_stream/aub_walker_partition_tests_xehp_and_later.cpp +++ b/opencl/test/unit_test/aub_tests/command_stream/aub_walker_partition_tests_xehp_and_later.cpp @@ -102,7 +102,7 @@ struct AubWalkerPartitionFixture : public KernelAUBFixture std::visit([&](auto &&walkerCmd) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); EXPECT_EQ(0u, walkerCmd->getPartitionId()); @@ -992,7 +992,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, AubWalkerPartitionZeroTest, givenNonBlockingAtomicO HWCMDTEST_F(IGFX_XE_HP_CORE, AubWalkerPartitionZeroTest, givenPredicatedCommandBufferWhenItIsExecutedThenAtomicIsIncrementedEquallyToPartitionCountPlusOne) { MockExecutionEnvironment mockExecutionEnvironment{}; using DefaultWalkerType = typename FamilyType::DefaultWalkerType; - using PostSyncType = typename DefaultWalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); auto streamCpuPointer = taskStream->getSpace(0); auto postSyncAddress = helperSurface->getGpuAddress(); diff --git a/opencl/test/unit_test/command_queue/dispatch_walker_tests_dg2_and_later.cpp b/opencl/test/unit_test/command_queue/dispatch_walker_tests_dg2_and_later.cpp index 99893fa9d1..28d2793025 100644 --- a/opencl/test/unit_test/command_queue/dispatch_walker_tests_dg2_and_later.cpp +++ b/opencl/test/unit_test/command_queue/dispatch_walker_tests_dg2_and_later.cpp @@ -92,7 +92,7 @@ HWTEST2_F(WalkerDispatchTestDg2AndLater, givenDebugVariableSetWhenProgramCompute HWTEST2_F(Dg2AndLaterDispatchWalkerBasicTest, givenTimestampPacketWhenDispatchingThenProgramPostSyncData, matcherDG2AndLater) { using DefaultWalkerType = typename FamilyType::DefaultWalkerType; - using POSTSYNC_DATA = typename DefaultWalkerType::PostSyncType; + using POSTSYNC_DATA = decltype(FamilyType::template getPostSyncType()); MockKernelWithInternals kernel1(*device); MockKernelWithInternals kernel2(*device); diff --git a/opencl/test/unit_test/command_queue/dispatch_walker_tests_xehp_and_later.cpp b/opencl/test/unit_test/command_queue/dispatch_walker_tests_xehp_and_later.cpp index 15a10e7e88..efd8d323dd 100644 --- a/opencl/test/unit_test/command_queue/dispatch_walker_tests_xehp_and_later.cpp +++ b/opencl/test/unit_test/command_queue/dispatch_walker_tests_xehp_and_later.cpp @@ -452,7 +452,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, givenWorkDimTh HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, givenTimestampPacketWhenDispatchingThenProgramPostSyncData) { using DefaultWalkerType = typename FamilyType::DefaultWalkerType; - using PostSyncType = typename DefaultWalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); MockKernelWithInternals kernel1(*device); MockKernelWithInternals kernel2(*device); @@ -525,7 +525,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, givenDebugVari WalkerVariant walkerVariant = NEO::UnitTestHelper::getWalkerVariant(*hwParser.itorWalker); std::visit([expectedMocs](auto &&walker) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); auto &postSyncData = walker->getPostSync(); EXPECT_EQ(PostSyncType::OPERATION::OPERATION_WRITE_TIMESTAMP, postSyncData.getOperation()); @@ -611,7 +611,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, givenDebugVari WalkerVariant walkerVariant = NEO::UnitTestHelper::getWalkerVariant(*hwParser.itorWalker); std::visit([contextEndAddress](auto &&walker) { using WalkerType = std::decay_t; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); ASSERT_NE(nullptr, walker); auto &postSyncData = walker->getPostSync(); diff --git a/shared/source/command_container/command_encoder_from_xe_hpg_core_to_xe3_core.inl b/shared/source/command_container/command_encoder_from_xe_hpg_core_to_xe3_core.inl index b9fc5e50b2..259e2e8b57 100644 --- a/shared/source/command_container/command_encoder_from_xe_hpg_core_to_xe3_core.inl +++ b/shared/source/command_container/command_encoder_from_xe_hpg_core_to_xe3_core.inl @@ -50,7 +50,7 @@ bool EncodeDispatchKernel::singleTileExecImplicitScalingRequired(bool co template template void EncodeDispatchKernel::setupPostSyncForInOrderExec(WalkerType &walkerCmd, const EncodeDispatchKernelArgs &args) { - using POSTSYNC_DATA = typename WalkerType::PostSyncType; + using POSTSYNC_DATA = decltype(Family::template getPostSyncType()); auto &postSync = walkerCmd.getPostSync(); diff --git a/shared/source/command_container/command_encoder_xehp_and_later.inl b/shared/source/command_container/command_encoder_xehp_and_later.inl index 04a424e6b9..0f0133ed78 100644 --- a/shared/source/command_container/command_encoder_xehp_and_later.inl +++ b/shared/source/command_container/command_encoder_xehp_and_later.inl @@ -465,7 +465,7 @@ void EncodeDispatchKernel::encode(CommandContainer &container, EncodeDis template template void EncodeDispatchKernel::setupPostSyncForRegularEvent(WalkerType &walkerCmd, const EncodeDispatchKernelArgs &args) { - using POSTSYNC_DATA = typename WalkerType::PostSyncType; + using POSTSYNC_DATA = decltype(Family::template getPostSyncType()); auto &postSync = walkerCmd.getPostSync(); @@ -903,8 +903,8 @@ inline size_t EncodeDispatchKernel::getInlineDataOffset(EncodeDispatchKe template template void EncodeDispatchKernel::forceComputeWalkerPostSyncFlushWithWrite(WalkerType &walkerCmd) { - using PostSyncType = typename WalkerType::PostSyncType; - using OperationType = typename PostSyncType::OPERATION; + using POSTSYNC_DATA = decltype(Family::template getPostSyncType()); + using OperationType = typename POSTSYNC_DATA::OPERATION; if (debugManager.flags.ForceComputeWalkerPostSyncFlushWithWrite.get() != -1) { auto &postSync = walkerCmd.getPostSync(); diff --git a/shared/source/generated/xe2_hpg_core/hw_cmds_generated_xe2_hpg_core.inl b/shared/source/generated/xe2_hpg_core/hw_cmds_generated_xe2_hpg_core.inl index 98dc820129..191b26b755 100644 --- a/shared/source/generated/xe2_hpg_core/hw_cmds_generated_xe2_hpg_core.inl +++ b/shared/source/generated/xe2_hpg_core/hw_cmds_generated_xe2_hpg_core.inl @@ -5953,8 +5953,6 @@ typedef struct tagCOMPUTE_WALKER { return sizeof(TheStructure.Common.InlineData); } using InterfaceDescriptorType = std::decay_t; // patched - using PostSyncType = std::decay_t; // patched - } COMPUTE_WALKER; STATIC_ASSERT(160 == sizeof(COMPUTE_WALKER)); diff --git a/shared/source/generated/xe3_core/hw_cmds_generated_xe3_core.inl b/shared/source/generated/xe3_core/hw_cmds_generated_xe3_core.inl index 92c88b158a..6742ac905f 100644 --- a/shared/source/generated/xe3_core/hw_cmds_generated_xe3_core.inl +++ b/shared/source/generated/xe3_core/hw_cmds_generated_xe3_core.inl @@ -5981,7 +5981,6 @@ typedef struct tagCOMPUTE_WALKER { return sizeof(TheStructure.Common.InlineData); } using InterfaceDescriptorType = std::decay_t; // patched - using PostSyncType = std::decay_t; // patched } COMPUTE_WALKER; STATIC_ASSERT(160 == sizeof(COMPUTE_WALKER)); diff --git a/shared/source/generated/xe_hpc_core/hw_cmds_generated_xe_hpc_core.inl b/shared/source/generated/xe_hpc_core/hw_cmds_generated_xe_hpc_core.inl index 3d4d04c163..689b461a4e 100644 --- a/shared/source/generated/xe_hpc_core/hw_cmds_generated_xe_hpc_core.inl +++ b/shared/source/generated/xe_hpc_core/hw_cmds_generated_xe_hpc_core.inl @@ -5815,8 +5815,6 @@ typedef struct tagCOMPUTE_WALKER { return sizeof(TheStructure.Common.InlineData); } using InterfaceDescriptorType = std::decay_t; // patched - using PostSyncType = std::decay_t; // patched - } COMPUTE_WALKER; STATIC_ASSERT(156 == sizeof(COMPUTE_WALKER)); diff --git a/shared/source/generated/xe_hpg_core/hw_cmds_generated_xe_hpg_core.inl b/shared/source/generated/xe_hpg_core/hw_cmds_generated_xe_hpg_core.inl index a2713cf19d..be77091be5 100644 --- a/shared/source/generated/xe_hpg_core/hw_cmds_generated_xe_hpg_core.inl +++ b/shared/source/generated/xe_hpg_core/hw_cmds_generated_xe_hpg_core.inl @@ -5584,8 +5584,6 @@ typedef struct tagCOMPUTE_WALKER { return sizeof(TheStructure.Common.InlineData); } using InterfaceDescriptorType = std::decay_t; // patched - using PostSyncType = std::decay_t; // patched - } COMPUTE_WALKER; STATIC_ASSERT(156 == sizeof(COMPUTE_WALKER)); diff --git a/shared/source/xe2_hpg_core/hw_cmds_base.h b/shared/source/xe2_hpg_core/hw_cmds_base.h index afb6c920f7..68d1d743d6 100644 --- a/shared/source/xe2_hpg_core/hw_cmds_base.h +++ b/shared/source/xe2_hpg_core/hw_cmds_base.h @@ -179,6 +179,12 @@ struct Xe2HpgCoreFamily : public Xe2HpgCore { static constexpr bool isInterfaceDescriptorHeaplessMode() { return false; } + + template + static constexpr auto getPostSyncType() { + return std::decay_t{}; + } + using WalkerVariant = std::variant; }; diff --git a/shared/source/xe3_core/hw_cmds_base.h b/shared/source/xe3_core/hw_cmds_base.h index 546f0bf0c5..663ce73779 100644 --- a/shared/source/xe3_core/hw_cmds_base.h +++ b/shared/source/xe3_core/hw_cmds_base.h @@ -184,6 +184,11 @@ struct Xe3CoreFamily : public Xe3Core { return false; } + template + static constexpr auto getPostSyncType() { + return std::decay_t{}; + } + using WalkerVariant = std::variant; }; diff --git a/shared/source/xe_hpc_core/hw_cmds_xe_hpc_core_base.h b/shared/source/xe_hpc_core/hw_cmds_xe_hpc_core_base.h index 0d7eda5998..a6e1cc5548 100644 --- a/shared/source/xe_hpc_core/hw_cmds_xe_hpc_core_base.h +++ b/shared/source/xe_hpc_core/hw_cmds_xe_hpc_core_base.h @@ -160,6 +160,12 @@ struct XeHpcCoreFamily : public XeHpcCore { static constexpr bool isInterfaceDescriptorHeaplessMode() { return false; } + + template + static constexpr auto getPostSyncType() { + return std::decay_t{}; + } + using WalkerVariant = std::variant; }; diff --git a/shared/source/xe_hpg_core/hw_cmds_xe_hpg_core_base.h b/shared/source/xe_hpg_core/hw_cmds_xe_hpg_core_base.h index 9dfc1e83ed..415651b9a4 100644 --- a/shared/source/xe_hpg_core/hw_cmds_xe_hpg_core_base.h +++ b/shared/source/xe_hpg_core/hw_cmds_xe_hpg_core_base.h @@ -178,6 +178,12 @@ struct XeHpgCoreFamily : public XeHpgCore { static constexpr bool isInterfaceDescriptorHeaplessMode() { return false; } + + template + static auto getPostSyncType() { + return std::decay_t{}; + } + using WalkerVariant = std::variant; }; diff --git a/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp b/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp index c7305cf6f4..768f0a6ac8 100644 --- a/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp +++ b/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp @@ -372,7 +372,7 @@ HWTEST2_F(CommandEncodeStatesTest, giveNumSamplersOneWhenDispatchKernelThensampl HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenEventAllocationWhenDispatchingKernelThenPostSyncIsAdded) { using DefaultWalkerType = typename FamilyType::DefaultWalkerType; - using POSTSYNC_DATA = typename DefaultWalkerType::PostSyncType; + using POSTSYNC_DATA = decltype(FamilyType::template getPostSyncType()); uint32_t dims[] = {2, 1, 1}; std::unique_ptr dispatchInterface(new MockDispatchKernelEncoder()); uint64_t eventAddress = MemoryConstants::cacheLineSize * 123; @@ -1370,7 +1370,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesDynamicImplicitScaling, givenImp HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenNonTimestampEventWhenTimestampPostSyncRequiredThenTimestampPostSyncIsAdded) { using DefaultWalkerType = typename FamilyType::DefaultWalkerType; - using POSTSYNC_DATA = typename DefaultWalkerType::PostSyncType; + using POSTSYNC_DATA = decltype(FamilyType::template getPostSyncType()); uint32_t dims[] = {2, 1, 1}; std::unique_ptr dispatchInterface(new MockDispatchKernelEncoder()); uint64_t eventAddress = MemoryConstants::cacheLineSize * 123; @@ -1627,7 +1627,7 @@ HWTEST2_F(CommandEncodeStatesTest, givenEncodeDispatchKernelWhenRequestingExtraP HWTEST2_F(CommandEncodeStatesTest, givenForceComputeWalkerPostSyncFlushWithWriteWhenEncodeIsCalledThenPostSyncIsProgrammedCorrectly, IsAtLeastXeHpCore) { using DefaultWalkerType = typename FamilyType::DefaultWalkerType; - using PostSyncType = typename DefaultWalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using OPERATION = typename PostSyncType::OPERATION; DebugManagerStateRestore restore; diff --git a/shared/test/unit_test/encoders/test_implicit_scaling_xehp_and_later.cpp b/shared/test/unit_test/encoders/test_implicit_scaling_xehp_and_later.cpp index 4fd42779ec..8abe6d45cf 100644 --- a/shared/test/unit_test/encoders/test_implicit_scaling_xehp_and_later.cpp +++ b/shared/test/unit_test/encoders/test_implicit_scaling_xehp_and_later.cpp @@ -19,7 +19,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, ImplicitScalingTests, GivenGetSizeWhenDispatchingCmdBufferThenConsumedSizeMatchEstimatedAndCmdBufferHasCorrectCmds) { using DefaultWalkerType = typename FamilyType::DefaultWalkerType; - using PostSyncType = typename DefaultWalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START; uint64_t postSyncAddress = (1ull << 48) | (1ull << 24); @@ -63,7 +63,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, ImplicitScalingTests, GivenGetSizeWhenDispatchingCm HWCMDTEST_F(IGFX_XE_HP_CORE, ImplicitScalingTests, GivenWorkgroupOneAndNoPartitionHintWhenDispatchingCmdBufferThenPartitionCountOneAndPartitionTypeDisabled) { using DefaultWalkerType = typename FamilyType::DefaultWalkerType; - using PostSyncType = typename DefaultWalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START; uint64_t postSyncAddress = (1ull << 48) | (1ull << 24); @@ -108,7 +108,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, ImplicitScalingTests, GivenWorkgroupOneAndNoPartiti HWCMDTEST_F(IGFX_XE_HP_CORE, ImplicitScalingTests, GivenWorkgroupOneAndPartitionHintWhenDispatchingCmdBufferThenPartitionCountOneAndPartitionTypeFromHint) { using DefaultWalkerType = typename FamilyType::DefaultWalkerType; - using PostSyncType = typename DefaultWalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START; uint64_t postSyncAddress = (1ull << 48) | (1ull << 24); @@ -153,7 +153,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, ImplicitScalingTests, GivenWorkgroupOneAndPartition HWCMDTEST_F(IGFX_XE_HP_CORE, ImplicitScalingTests, GivenStaticPartitioningWhenDispatchingCmdBufferThenCorrectStaticPartitioningCommandsAreProgrammed) { using DefaultWalkerType = typename FamilyType::DefaultWalkerType; - using PostSyncType = typename DefaultWalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START; using MI_LOAD_REGISTER_MEM = typename FamilyType::MI_LOAD_REGISTER_MEM; @@ -205,7 +205,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, ImplicitScalingTests, GivenStaticPartitioningWhenDi HWCMDTEST_F(IGFX_XE_HP_CORE, ImplicitScalingTests, GivenStaticPartitioningWhenPartitionRegisterIsRequiredThenCorrectStaticPartitioningCommandsAreProgrammed) { using DefaultWalkerType = typename FamilyType::DefaultWalkerType; - using PostSyncType = typename DefaultWalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START; using MI_LOAD_REGISTER_MEM = typename FamilyType::MI_LOAD_REGISTER_MEM; @@ -261,7 +261,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, ImplicitScalingTests, GivenStaticPartitioningWhenPa HWCMDTEST_F(IGFX_XE_HP_CORE, ImplicitScalingTests, GivenStaticPartitioningPreferredAndPartitionCountIsOneWhenDispatchingCmdBufferThenCorrectStaticPartitioningCommandsAreProgrammed) { using DefaultWalkerType = typename FamilyType::DefaultWalkerType; - using PostSyncType = typename DefaultWalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START; using MI_LOAD_REGISTER_MEM = typename FamilyType::MI_LOAD_REGISTER_MEM; @@ -313,7 +313,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, ImplicitScalingTests, GivenStaticPartitioningPrefer HWCMDTEST_F(IGFX_XE_HP_CORE, ImplicitScalingTests, GivenStaticPartitioningPreferredWhenForceDisabledWparidRegisterThenExpectNoCommandFound) { using DefaultWalkerType = typename FamilyType::DefaultWalkerType; - using PostSyncType = typename DefaultWalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START; using MI_LOAD_REGISTER_MEM = typename FamilyType::MI_LOAD_REGISTER_MEM; @@ -351,7 +351,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, ImplicitScalingTests, GivenStaticPartitioningPrefer HWCMDTEST_F(IGFX_XE_HP_CORE, ImplicitScalingTests, GivenStaticPartitioningPreferredWhenForceDisabledPipeControlThenExpectNoCommandFound) { using DefaultWalkerType = typename FamilyType::DefaultWalkerType; - using PostSyncType = typename DefaultWalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START; using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; @@ -389,7 +389,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, ImplicitScalingTests, GivenStaticPartitioningPrefer HWCMDTEST_F(IGFX_XE_HP_CORE, ImplicitScalingTests, GivenDynamicPartitioningPreferredWhenForceDisabledPipeControlThenExpectNoCommandFound) { using DefaultWalkerType = typename FamilyType::DefaultWalkerType; - using PostSyncType = typename DefaultWalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); using BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START; using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; @@ -1593,7 +1593,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, ImplicitScalingTests, HWCMDTEST_F(IGFX_XE_HP_CORE, ImplicitScalingTests, givenStaticPartitioningWhenBlockDispatchFlagIsTrueThenDoNotDispatchAnyCommands) { using DefaultWalkerType = typename FamilyType::DefaultWalkerType; - using PostSyncType = typename DefaultWalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); uint64_t postSyncAddress = (1ull << 48) | (1ull << 24); diff --git a/shared/test/unit_test/encoders/walker_partition_fixture_xehp_and_later.h b/shared/test/unit_test/encoders/walker_partition_fixture_xehp_and_later.h index d692f138a8..be3c24ec46 100644 --- a/shared/test/unit_test/encoders/walker_partition_fixture_xehp_and_later.h +++ b/shared/test/unit_test/encoders/walker_partition_fixture_xehp_and_later.h @@ -23,7 +23,7 @@ struct WalkerPartitionTests : public ::testing::Test { template auto createWalker(uint64_t postSyncAddress) { using WalkerType = typename GfxFamily::DefaultWalkerType; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(GfxFamily::template getPostSyncType()); WalkerType walker; walker = GfxFamily::template getInitGpuWalker(); diff --git a/shared/test/unit_test/encoders/walker_partition_tests_xehp_and_later_1.cpp b/shared/test/unit_test/encoders/walker_partition_tests_xehp_and_later_1.cpp index 57d1a71f5e..d2edcb3d7c 100644 --- a/shared/test/unit_test/encoders/walker_partition_tests_xehp_and_later_1.cpp +++ b/shared/test/unit_test/encoders/walker_partition_tests_xehp_and_later_1.cpp @@ -15,7 +15,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerPartitionWhenConstructCommandBufferIsCalledThenBatchBufferIsBeingProgrammed) { using WalkerType = typename FamilyType::DefaultWalkerType; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); MockExecutionEnvironment mockExecutionEnvironment{}; mockExecutionEnvironment.incRefInternal(); @@ -1097,7 +1097,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWit HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenDebugModesForWalkerPartitionWhenConstructCommandBufferIsCalledThenBatchBufferIsBeingProgrammed) { using WalkerType = typename FamilyType::DefaultWalkerType; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); MockExecutionEnvironment mockExecutionEnvironment{}; mockExecutionEnvironment.incRefInternal(); diff --git a/shared/test/unit_test/encoders/walker_partition_tests_xehp_and_later_2.cpp b/shared/test/unit_test/encoders/walker_partition_tests_xehp_and_later_2.cpp index c0b93186d8..996c8c7843 100644 --- a/shared/test/unit_test/encoders/walker_partition_tests_xehp_and_later_2.cpp +++ b/shared/test/unit_test/encoders/walker_partition_tests_xehp_and_later_2.cpp @@ -912,7 +912,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitioningWhenZD HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenSelfCleanupSectionWhenDebugForceDisableCrossTileSyncThenSelfCleanupOverridesDebugAndAddsOwnCleanupSection) { using WalkerType = typename FamilyType::DefaultWalkerType; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); MockExecutionEnvironment mockExecutionEnvironment{}; mockExecutionEnvironment.incRefInternal(); @@ -1124,7 +1124,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenSelfCleanupSectionWhenDe HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenSelfCleanupAndAtomicsUsedForCleanupWhenDebugForceDisableCrossTileSyncThenSelfCleanupOverridesDebugAndAddsOwnCleanupSection) { using WalkerType = typename FamilyType::DefaultWalkerType; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); MockExecutionEnvironment mockExecutionEnvironment{}; mockExecutionEnvironment.incRefInternal(); @@ -1345,7 +1345,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenSelfCleanupAndAtomicsUse HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenDynamicPartitioningWhenPipeControlProgrammingDisabledThenExpectNoPipeControlCommand) { using WalkerType = typename FamilyType::DefaultWalkerType; - using PostSyncType = typename WalkerType::PostSyncType; + using PostSyncType = decltype(FamilyType::template getPostSyncType()); testArgs.crossTileAtomicSynchronization = false; testArgs.partitionCount = 16u; diff --git a/shared/test/unit_test/xe_hpg_core/hw_cmds_xe_hpg_core_tests.cpp b/shared/test/unit_test/xe_hpg_core/hw_cmds_xe_hpg_core_tests.cpp index 2df4530440..c492100550 100644 --- a/shared/test/unit_test/xe_hpg_core/hw_cmds_xe_hpg_core_tests.cpp +++ b/shared/test/unit_test/xe_hpg_core/hw_cmds_xe_hpg_core_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2023 Intel Corporation + * Copyright (C) 2021-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,6 +15,12 @@ using namespace NEO; using XeHpgCoreHwCmdTest = ::testing::Test; +XE_HPG_CORETEST_F(XeHpgCoreHwCmdTest, givenComputeWalkerThenPostSyncTypeIsPostSyncData) { + auto postSyncType = FamilyType::template getPostSyncType(); + using POSTSYNC_DATA = typename FamilyType::POSTSYNC_DATA; + EXPECT_TRUE((std::is_same::value)); +} + XE_HPG_CORETEST_F(XeHpgCoreHwCmdTest, givenMediaSurfaceStateWhenProgrammingMocsThenMocsIndexIsSetProperly) { auto mediaSurfaceState = FamilyType::cmdInitMediaSurfaceState; uint32_t mocs = 4u;