diff --git a/opencl/test/unit_test/aub_tests/command_queue/aub_multicontext_tests_xehp_and_later.cpp b/opencl/test/unit_test/aub_tests/command_queue/aub_multicontext_tests_xehp_and_later.cpp index d34bf4b9a4..9a994a8e99 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/aub_multicontext_tests_xehp_and_later.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/aub_multicontext_tests_xehp_and_later.cpp @@ -463,7 +463,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, StaticWalkerPartitionFourTilesTests, givenPreWalker taskStream->getSpace(totalBytesProgrammed); flushTaskStream(*taskStream); - const auto controlSectionAddress = taskStreamGpu + WalkerPartition::computeStaticPartitioningControlSectionOffset(testArgs); + const auto controlSectionAddress = taskStreamGpu + WalkerPartition::computeStaticPartitioningControlSectionOffset(testArgs); const auto preWalkerSyncAddress = controlSectionAddress + offsetof(WalkerPartition::StaticPartitioningControlSection, synchronizeBeforeWalkerCounter); const auto postWalkerSyncAddress = controlSectionAddress + offsetof(WalkerPartition::StaticPartitioningControlSection, synchronizeAfterWalkerCounter); uint32_t expectedValue = 0x4; @@ -509,7 +509,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, StaticWalkerPartitionFourTilesTests, whenNoPreWalke taskStream->getSpace(totalBytesProgrammed); flushTaskStream(*taskStream); - const auto controlSectionAddress = taskStreamGpu + WalkerPartition::computeStaticPartitioningControlSectionOffset(testArgs); + const auto controlSectionAddress = taskStreamGpu + WalkerPartition::computeStaticPartitioningControlSectionOffset(testArgs); const auto preWalkerSyncAddress = controlSectionAddress + offsetof(WalkerPartition::StaticPartitioningControlSection, synchronizeBeforeWalkerCounter); const auto postWalkerSyncAddress = controlSectionAddress + offsetof(WalkerPartition::StaticPartitioningControlSection, synchronizeAfterWalkerCounter); uint32_t expectedValue = 0x0; 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 51c1fc5dda..df29b7def2 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 @@ -1009,7 +1009,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, AubWalkerPartitionZeroTest, givenPredicatedCommandB taskStream->getSpace(totalBytesProgrammed); flushStream(); auto expectedGpuAddress = taskStream->getGraphicsAllocation()->getGpuAddress() + - WalkerPartition::computeControlSectionOffset(testArgs); + WalkerPartition::computeControlSectionOffset(testArgs); // 16 partitions updated atomic to value 16 // 17th partition updated it to 17 and was predicated out of the batch buffer 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 7281cf5527..41830b9519 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 @@ -1080,6 +1080,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, givenPassInlin } HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeControlIsRequiredWhenWalkerPartitionIsOnThenSizeIsProperlyEstimated) { + using WalkerType = typename FamilyType::DefaultWalkerType; + debugManager.flags.EnableWalkerPartition.set(1u); VariableBackup pipeControlConfigBackup(&ImplicitScalingDispatch::getPipeControlStallRequired(), true); UltClDeviceFactory deviceFactory{1, 2}; @@ -1091,7 +1093,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeContr size_t numPipeControls = MemorySynchronizationCommands::isBarrierWaRequired(device->getRootDeviceEnvironment()) ? 2 : 1; - auto baseSize = sizeof(typename FamilyType::COMPUTE_WALKER) + + auto baseSize = sizeof(WalkerType) + (sizeof(typename FamilyType::PIPE_CONTROL) * numPipeControls) + HardwareCommandsHelper::getSizeRequiredCS() + EncodeMemoryPrefetch::getSizeForMemoryPrefetch(kernel->kernelInfo.heapInfo.kernelHeapSize, device->getRootDeviceEnvironment()); @@ -1111,13 +1113,13 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeContr testArgs.staticPartitioning = false; testArgs.synchronizeBeforeExecution = false; csr.staticWorkPartitioningEnabled = false; - auto partitionSize = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); + auto partitionSize = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); auto returnedSize = EnqueueOperation::getSizeRequiredCS(CL_COMMAND_NDRANGE_KERNEL, false, false, *cmdQ.get(), kernel->mockKernel, dispatchInfo); EXPECT_EQ(returnedSize, partitionSize + baseSize); testArgs.staticPartitioning = true; csr.staticWorkPartitioningEnabled = true; - partitionSize = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); + partitionSize = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); returnedSize = EnqueueOperation::getSizeRequiredCS(CL_COMMAND_NDRANGE_KERNEL, false, false, *cmdQ.get(), kernel->mockKernel, dispatchInfo); EXPECT_EQ(returnedSize, partitionSize + baseSize); @@ -1125,19 +1127,21 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeContr testArgs.synchronizeBeforeExecution = true; testArgs.staticPartitioning = false; csr.staticWorkPartitioningEnabled = false; - partitionSize = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); + partitionSize = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); returnedSize = EnqueueOperation::getSizeRequiredCS(CL_COMMAND_NDRANGE_KERNEL, false, false, *cmdQ.get(), kernel->mockKernel, dispatchInfo); EXPECT_EQ(returnedSize, partitionSize + baseSize); testArgs.synchronizeBeforeExecution = true; testArgs.staticPartitioning = true; csr.staticWorkPartitioningEnabled = true; - partitionSize = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); + partitionSize = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); returnedSize = EnqueueOperation::getSizeRequiredCS(CL_COMMAND_NDRANGE_KERNEL, false, false, *cmdQ.get(), kernel->mockKernel, dispatchInfo); EXPECT_EQ(returnedSize, partitionSize + baseSize); } HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeControlIsNotRequiredWhenWalkerPartitionIsOnThenSizeIsProperlyEstimated) { + using WalkerType = typename FamilyType::DefaultWalkerType; + debugManager.flags.EnableWalkerPartition.set(1u); VariableBackup pipeControlConfigBackup(&ImplicitScalingDispatch::getPipeControlStallRequired(), false); UltClDeviceFactory deviceFactory{1, 2}; @@ -1149,7 +1153,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeContr size_t numPipeControls = MemorySynchronizationCommands::isBarrierWaRequired(device->getRootDeviceEnvironment()) ? 2 : 1; - auto baseSize = sizeof(typename FamilyType::COMPUTE_WALKER) + + auto baseSize = sizeof(WalkerType) + (sizeof(typename FamilyType::PIPE_CONTROL) * numPipeControls) + HardwareCommandsHelper::getSizeRequiredCS() + EncodeMemoryPrefetch::getSizeForMemoryPrefetch(kernel->kernelInfo.heapInfo.kernelHeapSize, device->getRootDeviceEnvironment()); @@ -1169,13 +1173,13 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeContr testArgs.staticPartitioning = false; testArgs.synchronizeBeforeExecution = false; csr.staticWorkPartitioningEnabled = false; - auto partitionSize = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); + auto partitionSize = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); auto returnedSize = EnqueueOperation::getSizeRequiredCS(CL_COMMAND_NDRANGE_KERNEL, false, false, *cmdQ.get(), kernel->mockKernel, dispatchInfo); EXPECT_EQ(returnedSize, partitionSize + baseSize); testArgs.staticPartitioning = true; csr.staticWorkPartitioningEnabled = true; - partitionSize = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); + partitionSize = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); returnedSize = EnqueueOperation::getSizeRequiredCS(CL_COMMAND_NDRANGE_KERNEL, false, false, *cmdQ.get(), kernel->mockKernel, dispatchInfo); EXPECT_EQ(returnedSize, partitionSize + baseSize); @@ -1183,14 +1187,14 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeContr testArgs.synchronizeBeforeExecution = true; testArgs.staticPartitioning = false; csr.staticWorkPartitioningEnabled = false; - partitionSize = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); + partitionSize = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); returnedSize = EnqueueOperation::getSizeRequiredCS(CL_COMMAND_NDRANGE_KERNEL, false, false, *cmdQ.get(), kernel->mockKernel, dispatchInfo); EXPECT_EQ(returnedSize, partitionSize + baseSize); testArgs.synchronizeBeforeExecution = true; testArgs.staticPartitioning = true; csr.staticWorkPartitioningEnabled = true; - partitionSize = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); + partitionSize = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); returnedSize = EnqueueOperation::getSizeRequiredCS(CL_COMMAND_NDRANGE_KERNEL, false, false, *cmdQ.get(), kernel->mockKernel, dispatchInfo); EXPECT_EQ(returnedSize, partitionSize + baseSize); } @@ -1231,6 +1235,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, whenPipeContro } HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeControlIsRequiredWhenQueueIsMultiEngineCapableThenWalkerPartitionsAreEstimated) { + using WalkerType = typename FamilyType::DefaultWalkerType; + debugManager.flags.EnableWalkerPartition.set(1u); VariableBackup pipeControlConfigBackup(&ImplicitScalingDispatch::getPipeControlStallRequired(), true); @@ -1239,7 +1245,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeContr size_t numPipeControls = MemorySynchronizationCommands::isBarrierWaRequired(device->getRootDeviceEnvironment()) ? 2 : 1; - auto baseSize = sizeof(typename FamilyType::COMPUTE_WALKER) + + auto baseSize = sizeof(WalkerType) + (sizeof(typename FamilyType::PIPE_CONTROL) * numPipeControls) + HardwareCommandsHelper::getSizeRequiredCS() + EncodeMemoryPrefetch::getSizeForMemoryPrefetch(kernel->kernelInfo.heapInfo.kernelHeapSize, device->getRootDeviceEnvironment()); @@ -1252,7 +1258,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeContr testArgs.dcFlushEnable = csr.getDcFlushSupport(); testArgs.tileCount = static_cast(device->getDeviceBitfield().count()); - auto partitionSize = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); + auto partitionSize = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); DispatchInfo dispatchInfo{}; dispatchInfo.setNumberOfWorkgroups({32, 1, 1}); @@ -1262,6 +1268,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeContr } HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeControlIsNotRequiredWhenQueueIsMultiEngineCapableThenWalkerPartitionsAreEstimated) { + using WalkerType = typename FamilyType::DefaultWalkerType; + debugManager.flags.EnableWalkerPartition.set(1u); VariableBackup pipeControlConfigBackup(&ImplicitScalingDispatch::getPipeControlStallRequired(), false); @@ -1270,7 +1278,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeContr size_t numPipeControls = MemorySynchronizationCommands::isBarrierWaRequired(device->getRootDeviceEnvironment()) ? 2 : 1; - auto baseSize = sizeof(typename FamilyType::COMPUTE_WALKER) + + auto baseSize = sizeof(WalkerType) + (sizeof(typename FamilyType::PIPE_CONTROL) * numPipeControls) + HardwareCommandsHelper::getSizeRequiredCS() + EncodeMemoryPrefetch::getSizeForMemoryPrefetch(kernel->kernelInfo.heapInfo.kernelHeapSize, device->getRootDeviceEnvironment()); @@ -1283,7 +1291,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, GivenPipeContr testArgs.dcFlushEnable = csr.getDcFlushSupport(); testArgs.tileCount = static_cast(device->getDeviceBitfield().count()); - auto partitionSize = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); + auto partitionSize = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); DispatchInfo dispatchInfo{}; dispatchInfo.setNumberOfWorkgroups({32, 1, 1}); diff --git a/shared/source/command_container/implicit_scaling_xehp_and_later.inl b/shared/source/command_container/implicit_scaling_xehp_and_later.inl index a0032d2451..4d60bfe9ad 100644 --- a/shared/source/command_container/implicit_scaling_xehp_and_later.inl +++ b/shared/source/command_container/implicit_scaling_xehp_and_later.inl @@ -84,7 +84,7 @@ size_t ImplicitScalingDispatch::getSize(bool apiSelfCleanup, false, false); - return static_cast(WalkerPartition::estimateSpaceRequiredInCommandBuffer(args)); + return static_cast(WalkerPartition::estimateSpaceRequiredInCommandBuffer(args)); } template diff --git a/shared/source/command_container/walker_partition_xehp_and_later.h b/shared/source/command_container/walker_partition_xehp_and_later.h index 8f359bcd5d..87baf35b76 100644 --- a/shared/source/command_container/walker_partition_xehp_and_later.h +++ b/shared/source/command_container/walker_partition_xehp_and_later.h @@ -27,8 +27,6 @@ struct PipeControlArgs; namespace WalkerPartition { -template -using COMPUTE_WALKER = typename GfxFamily::COMPUTE_WALKER; template using POSTSYNC_DATA = typename GfxFamily::POSTSYNC_DATA; template @@ -455,13 +453,13 @@ void programTilesSynchronizationWithPostSyncs(void *¤tBatchBufferPointer, } } -template +template uint64_t computeWalkerSectionSize() { return sizeof(BATCH_BUFFER_START) + - sizeof(COMPUTE_WALKER); + sizeof(WalkerType); } -template +template uint64_t computeControlSectionOffset(WalkerPartitionArgs &args) { uint64_t size = 0u; @@ -472,7 +470,7 @@ uint64_t computeControlSectionOffset(WalkerPartitionArgs &args) { size += sizeof(MI_SET_PREDICATE) * 2 + sizeof(BATCH_BUFFER_START) * 2; size += (args.semaphoreProgrammingRequired ? NEO::EncodeSemaphore::getSizeMiSemaphoreWait() * args.partitionCount : 0u); - size += computeWalkerSectionSize(); + size += computeWalkerSectionSize(); size += args.emitPipeControlStall ? NEO::MemorySynchronizationCommands::getSizeForSingleBarrier(false) : 0u; if (args.crossTileAtomicSynchronization || args.emitSelfCleanup) { size += computeTilesSynchronizationWithAtomicsSectionSize(); @@ -484,10 +482,10 @@ uint64_t computeControlSectionOffset(WalkerPartitionArgs &args) { return size; } -template +template uint64_t computeWalkerSectionStart(WalkerPartitionArgs &args) { - return computeControlSectionOffset(args) - - computeWalkerSectionSize(); + return computeControlSectionOffset(args) - + computeWalkerSectionSize(); } template @@ -569,7 +567,7 @@ void constructDynamicallyPartitionedCommandBuffer(void *cpuPointer, totalBytesProgrammed = 0u; void *currentBatchBufferPointer = cpuPointer; - auto controlSectionOffset = computeControlSectionOffset(args); + auto controlSectionOffset = computeControlSectionOffset(args); if (args.synchronizeBeforeExecution) { auto tileAtomicAddress = gpuAddressOfAllocation + controlSectionOffset + offsetof(BatchBufferControlData, inTileCount); programTilesSynchronizationWithAtomics(currentBatchBufferPointer, totalBytesProgrammed, tileAtomicAddress, args.tileCount); @@ -592,7 +590,7 @@ void constructDynamicallyPartitionedCommandBuffer(void *cpuPointer, programMiBatchBufferStart(currentBatchBufferPointer, totalBytesProgrammed, gpuAddressOfAllocation + - computeWalkerSectionStart(args), + computeWalkerSectionStart(args), true, args.secondaryBatchBuffer); @@ -671,7 +669,7 @@ bool isStartAndControlSectionRequired(WalkerPartitionArgs &args) { return args.synchronizeBeforeExecution || args.crossTileAtomicSynchronization || args.emitSelfCleanup; } -template +template uint64_t computeStaticPartitioningControlSectionOffset(WalkerPartitionArgs &args) { const auto beforeExecutionSyncAtomicSize = args.synchronizeBeforeExecution ? computeTilesSynchronizationWithAtomicsSectionSize() @@ -697,7 +695,7 @@ uint64_t computeStaticPartitioningControlSectionOffset(WalkerPartitionArgs &args return beforeExecutionSyncAtomicSize + wparidRegisterSize + pipeControlSize + - sizeof(COMPUTE_WALKER) + + sizeof(WalkerType) + selfCleanupSectionSize + afterExecutionSyncAtomicSize + afterExecutionSyncPostSyncSize + @@ -716,7 +714,7 @@ void constructStaticallyPartitionedCommandBuffer(void *cpuPointer, void *currentBatchBufferPointer = cpuPointer; // Get address of the control section - const auto controlSectionOffset = computeStaticPartitioningControlSectionOffset(args); + const auto controlSectionOffset = computeStaticPartitioningControlSectionOffset(args); const auto afterControlSectionOffset = controlSectionOffset + sizeof(StaticPartitioningControlSection); // Synchronize tiles before walker @@ -781,15 +779,15 @@ void constructStaticallyPartitionedCommandBuffer(void *cpuPointer, } } -template +template uint64_t estimateSpaceRequiredInCommandBuffer(WalkerPartitionArgs &args) { uint64_t size = {}; if (args.staticPartitioning) { - size += computeStaticPartitioningControlSectionOffset(args); + size += computeStaticPartitioningControlSectionOffset(args); size += isStartAndControlSectionRequired(args) ? sizeof(StaticPartitioningControlSection) : 0u; size += args.emitSelfCleanup ? computeSelfCleanupEndSectionSize(staticPartitioningFieldsForCleanupCount, args) : 0u; } else { - size += computeControlSectionOffset(args); + size += computeControlSectionOffset(args); size += sizeof(BatchBufferControlData); size += args.emitBatchBufferEnd ? sizeof(BATCH_BUFFER_END) : 0u; size += args.emitSelfCleanup ? computeSelfCleanupEndSectionSize(dynamicPartitioningFieldsForCleanupCount, args) : 0u; 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 c3bed9b267..2cc3001bdd 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 @@ -1247,7 +1247,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesDynamicImplicitScaling, givenImp args.emitSelfCleanup = true; args.dcFlushEnable = dispatchArgs.dcFlushEnable; - auto cleanupSectionOffset = WalkerPartition::computeControlSectionOffset(args); + auto cleanupSectionOffset = WalkerPartition::computeControlSectionOffset(args); uint64_t expectedCleanupGpuVa = cmdContainer->getCommandStream()->getGraphicsAllocation()->getGpuAddress() + cleanupSectionOffset; constexpr uint32_t expectedData = 0ull; 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 fc42dfc65a..a541fda1db 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 @@ -22,9 +22,11 @@ struct WalkerPartitionTests : public ::testing::Test { template auto createWalker(uint64_t postSyncAddress) { - WalkerPartition::COMPUTE_WALKER walker; + using WalkerType = typename GfxFamily::DefaultWalkerType; + + WalkerType walker; walker = GfxFamily::cmdInitGpgpuWalker; - walker.setPartitionType(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X); + walker.setPartitionType(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X); auto &postSync = walker.getPostSync(); postSync.setOperation(POSTSYNC_DATA::OPERATION::OPERATION_WRITE_TIMESTAMP); postSync.setDestinationAddress(postSyncAddress); 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 07ddae81c8..7c6df74a78 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 @@ -13,6 +13,8 @@ #include "shared/test/unit_test/encoders/walker_partition_fixture_xehp_and_later.h" HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerPartitionWhenConstructCommandBufferIsCalledThenBatchBufferIsBeingProgrammed) { + using WalkerType = typename FamilyType::DefaultWalkerType; + MockExecutionEnvironment mockExecutionEnvironment{}; testArgs.partitionCount = 16u; testArgs.dcFlushEnable = MemorySynchronizationCommands::getDcFlushEnable(true, *mockExecutionEnvironment.rootDeviceEnvironments[0]); @@ -20,9 +22,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerPartitionWhenConst checkForProperCmdBufferAddressOffset = false; uint64_t gpuVirtualAddress = 0x8000123000; uint64_t postSyncAddress = 0x8000456000; - WalkerPartition::COMPUTE_WALKER walker; + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; - walker.setPartitionType(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X); + walker.setPartitionType(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X); auto &postSync = walker.getPostSync(); postSync.setOperation(POSTSYNC_DATA::OPERATION::OPERATION_WRITE_TIMESTAMP); postSync.setDestinationAddress(postSyncAddress); @@ -34,13 +36,14 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerPartitionWhenConst sizeof(WalkerPartition::MI_SET_PREDICATE) * 2 + sizeof(WalkerPartition::BATCH_BUFFER_START) * 3 + sizeof(WalkerPartition::PIPE_CONTROL) + - sizeof(WalkerPartition::COMPUTE_WALKER) + + sizeof(WalkerType) + sizeof(WalkerPartition::MI_SEMAPHORE_WAIT); auto walkerSectionCommands = sizeof(WalkerPartition::BATCH_BUFFER_START) + - sizeof(WalkerPartition::COMPUTE_WALKER); + sizeof(WalkerType); - EXPECT_EQ(expectedCommandUsedSize, computeControlSectionOffset(testArgs)); + auto offset = computeControlSectionOffset(testArgs); + EXPECT_EQ(expectedCommandUsedSize, offset); auto optionalBatchBufferEndOffset = expectedCommandUsedSize + sizeof(BatchBufferControlData); @@ -135,9 +138,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerPartitionWhenConst EXPECT_EQ(batchBufferStartFinal->getBatchBufferStartAddress(), gpuVirtualAddress + optionalBatchBufferEndOffset); parsedOffset += sizeof(WalkerPartition::BATCH_BUFFER_START); - auto computeWalker = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); + auto computeWalker = genCmdCast(ptrOffset(cmdBuffer, parsedOffset)); ASSERT_NE(nullptr, computeWalker); - parsedOffset += sizeof(WalkerPartition::COMPUTE_WALKER); + parsedOffset += sizeof(WalkerType); batchBufferStart = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); ASSERT_NE(nullptr, batchBufferStart); @@ -156,6 +159,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerPartitionWhenConst } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWhenConstructCommandBufferIsCalledThenBatchBufferIsBeingProgrammed) { + using WalkerType = typename FamilyType::DefaultWalkerType; + MockExecutionEnvironment mockExecutionEnvironment{}; testArgs.tileCount = 4u; testArgs.partitionCount = testArgs.tileCount; @@ -169,7 +174,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWhe auto walker = createWalker(postSyncAddress); uint32_t totalBytesProgrammed{}; - const auto controlSectionOffset = computeStaticPartitioningControlSectionOffset(testArgs); + const auto controlSectionOffset = computeStaticPartitioningControlSectionOffset(testArgs); const auto postWalkerSyncAddress = cmdBufferGpuAddress + controlSectionOffset + offsetof(StaticPartitioningControlSection, synchronizeAfterWalkerCounter); WalkerPartition::constructStaticallyPartitionedCommandBuffer(cmdBuffer, nullptr, @@ -191,9 +196,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWhe EXPECT_EQ(testArgs.workPartitionAllocationGpuVa, loadRegisterMem->getMemoryAddress()); } { - auto computeWalker = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); + auto computeWalker = genCmdCast(ptrOffset(cmdBuffer, parsedOffset)); ASSERT_NE(nullptr, computeWalker); - parsedOffset += sizeof(WalkerPartition::COMPUTE_WALKER); + parsedOffset += sizeof(WalkerType); } { auto pipeControl = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); @@ -239,6 +244,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWhe } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionAndPreWalkerSyncWhenConstructCommandBufferIsCalledThenBatchBufferIsBeingProgrammed) { + using WalkerType = typename FamilyType::DefaultWalkerType; + MockExecutionEnvironment mockExecutionEnvironment{}; testArgs.tileCount = 4u; testArgs.partitionCount = testArgs.tileCount; @@ -252,7 +259,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionAnd auto walker = createWalker(postSyncAddress); uint32_t totalBytesProgrammed{}; - const auto controlSectionOffset = computeStaticPartitioningControlSectionOffset(testArgs); + const auto controlSectionOffset = computeStaticPartitioningControlSectionOffset(testArgs); const auto postWalkerSyncAddress = cmdBufferGpuAddress + controlSectionOffset + offsetof(StaticPartitioningControlSection, synchronizeAfterWalkerCounter); const auto preWalkerSyncAddress = cmdBufferGpuAddress + controlSectionOffset + offsetof(StaticPartitioningControlSection, synchronizeBeforeWalkerCounter); WalkerPartition::constructStaticallyPartitionedCommandBuffer(cmdBuffer, @@ -294,9 +301,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionAnd EXPECT_EQ(testArgs.workPartitionAllocationGpuVa, loadRegisterMem->getMemoryAddress()); } { - auto computeWalker = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); + auto computeWalker = genCmdCast(ptrOffset(cmdBuffer, parsedOffset)); ASSERT_NE(nullptr, computeWalker); - parsedOffset += sizeof(WalkerPartition::COMPUTE_WALKER); + parsedOffset += sizeof(WalkerType); } { auto pipeControl = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); @@ -342,6 +349,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionAnd } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionAndSynchronizationWithPostSyncsWhenConstructCommandBufferIsCalledThenBatchBufferIsBeingProgrammed) { + using WalkerType = typename FamilyType::DefaultWalkerType; + MockExecutionEnvironment mockExecutionEnvironment{}; testArgs.semaphoreProgrammingRequired = true; testArgs.crossTileAtomicSynchronization = false; @@ -356,14 +365,14 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionAnd auto walker = createWalker(postSyncAddress); uint32_t totalBytesProgrammed{}; - const auto controlSectionOffset = computeStaticPartitioningControlSectionOffset(testArgs); - WalkerPartition::constructStaticallyPartitionedCommandBuffer(cmdBuffer, - nullptr, - cmdBufferGpuAddress, - &walker, - totalBytesProgrammed, - testArgs, - *defaultHwInfo); + const auto controlSectionOffset = computeStaticPartitioningControlSectionOffset(testArgs); + WalkerPartition::constructStaticallyPartitionedCommandBuffer(cmdBuffer, + nullptr, + cmdBufferGpuAddress, + &walker, + totalBytesProgrammed, + testArgs, + *defaultHwInfo); EXPECT_EQ(controlSectionOffset, totalBytesProgrammed); auto parsedOffset = 0u; @@ -377,9 +386,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionAnd EXPECT_EQ(testArgs.workPartitionAllocationGpuVa, loadRegisterMem->getMemoryAddress()); } { - auto computeWalker = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); + auto computeWalker = genCmdCast(ptrOffset(cmdBuffer, parsedOffset)); ASSERT_NE(nullptr, computeWalker); - parsedOffset += sizeof(WalkerPartition::COMPUTE_WALKER); + parsedOffset += sizeof(WalkerType); } { auto pipeControl = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); @@ -429,6 +438,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionAnd } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWithSelfCleanupWhenConstructCommandBufferIsCalledThenBatchBufferIsBeingProgrammed) { + using WalkerType = typename FamilyType::DefaultWalkerType; + MockExecutionEnvironment mockExecutionEnvironment{}; testArgs.tileCount = 4u; testArgs.partitionCount = testArgs.tileCount; @@ -443,7 +454,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWit auto walker = createWalker(postSyncAddress); uint32_t totalBytesProgrammed{}; - const auto controlSectionOffset = computeStaticPartitioningControlSectionOffset(testArgs); + const auto controlSectionOffset = computeStaticPartitioningControlSectionOffset(testArgs); const auto preWalkerSyncAddress = cmdBufferGpuAddress + controlSectionOffset + offsetof(StaticPartitioningControlSection, synchronizeBeforeWalkerCounter); const auto postWalkerSyncAddress = cmdBufferGpuAddress + controlSectionOffset + offsetof(StaticPartitioningControlSection, synchronizeAfterWalkerCounter); const auto finalSyncAddress = cmdBufferGpuAddress + controlSectionOffset + offsetof(StaticPartitioningControlSection, finalSyncTileCounter); @@ -454,7 +465,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWit totalBytesProgrammed, testArgs, *defaultHwInfo); - const auto expectedBytesProgrammed = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); + const auto expectedBytesProgrammed = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); EXPECT_EQ(expectedBytesProgrammed, totalBytesProgrammed); auto parsedOffset = 0u; @@ -468,9 +479,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWit EXPECT_EQ(testArgs.workPartitionAllocationGpuVa, loadRegisterMem->getMemoryAddress()); } { - auto computeWalker = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); + auto computeWalker = genCmdCast(ptrOffset(cmdBuffer, parsedOffset)); ASSERT_NE(nullptr, computeWalker); - parsedOffset += sizeof(WalkerPartition::COMPUTE_WALKER); + parsedOffset += sizeof(WalkerType); } { auto storeDataImm = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); @@ -581,6 +592,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWit } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWithSelfCleanupAndCrossTileSyncDisabledWithFlagWhenConstructCommandBufferIsCalledThenStillProgramTheSync) { + using WalkerType = typename FamilyType::DefaultWalkerType; + MockExecutionEnvironment mockExecutionEnvironment{}; testArgs.crossTileAtomicSynchronization = false; testArgs.tileCount = 4u; @@ -596,7 +609,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWit auto walker = createWalker(postSyncAddress); uint32_t totalBytesProgrammed{}; - const auto controlSectionOffset = computeStaticPartitioningControlSectionOffset(testArgs); + const auto controlSectionOffset = computeStaticPartitioningControlSectionOffset(testArgs); const auto preWalkerSyncAddress = cmdBufferGpuAddress + controlSectionOffset + offsetof(StaticPartitioningControlSection, synchronizeBeforeWalkerCounter); const auto postWalkerSyncAddress = cmdBufferGpuAddress + controlSectionOffset + offsetof(StaticPartitioningControlSection, synchronizeAfterWalkerCounter); const auto finalSyncAddress = cmdBufferGpuAddress + controlSectionOffset + offsetof(StaticPartitioningControlSection, finalSyncTileCounter); @@ -607,7 +620,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWit totalBytesProgrammed, testArgs, *defaultHwInfo); - const auto expectedBytesProgrammed = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); + const auto expectedBytesProgrammed = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); EXPECT_EQ(expectedBytesProgrammed, totalBytesProgrammed); auto parsedOffset = 0u; @@ -621,9 +634,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWit EXPECT_EQ(testArgs.workPartitionAllocationGpuVa, loadRegisterMem->getMemoryAddress()); } { - auto computeWalker = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); + auto computeWalker = genCmdCast(ptrOffset(cmdBuffer, parsedOffset)); ASSERT_NE(nullptr, computeWalker); - parsedOffset += sizeof(WalkerPartition::COMPUTE_WALKER); + parsedOffset += sizeof(WalkerType); } { auto storeDataImm = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); @@ -734,6 +747,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWit } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWithSelfCleanupAndAtomicsForSelfCleanupWhenConstructCommandBufferIsCalledThenBatchBufferIsBeingProgrammed) { + using WalkerType = typename FamilyType::DefaultWalkerType; + MockExecutionEnvironment mockExecutionEnvironment{}; testArgs.tileCount = 4u; testArgs.partitionCount = testArgs.tileCount; @@ -749,7 +764,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWit auto walker = createWalker(postSyncAddress); uint32_t totalBytesProgrammed{}; - const auto controlSectionOffset = computeStaticPartitioningControlSectionOffset(testArgs); + const auto controlSectionOffset = computeStaticPartitioningControlSectionOffset(testArgs); const auto preWalkerSyncAddress = cmdBufferGpuAddress + controlSectionOffset + offsetof(StaticPartitioningControlSection, synchronizeBeforeWalkerCounter); const auto postWalkerSyncAddress = cmdBufferGpuAddress + controlSectionOffset + offsetof(StaticPartitioningControlSection, synchronizeAfterWalkerCounter); const auto finalSyncAddress = cmdBufferGpuAddress + controlSectionOffset + offsetof(StaticPartitioningControlSection, finalSyncTileCounter); @@ -760,7 +775,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWit totalBytesProgrammed, testArgs, *defaultHwInfo); - const auto expectedBytesProgrammed = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); + const auto expectedBytesProgrammed = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); EXPECT_EQ(expectedBytesProgrammed, totalBytesProgrammed); auto parsedOffset = 0u; @@ -774,9 +789,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWit EXPECT_EQ(testArgs.workPartitionAllocationGpuVa, loadRegisterMem->getMemoryAddress()); } { - auto computeWalker = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); + auto computeWalker = genCmdCast(ptrOffset(cmdBuffer, parsedOffset)); ASSERT_NE(nullptr, computeWalker); - parsedOffset += sizeof(WalkerPartition::COMPUTE_WALKER); + parsedOffset += sizeof(WalkerType); } { auto miAtomic = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); @@ -893,6 +908,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWit } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWithSlefCleanupAndCrossTileSyncDisabledWithFlagWhenUsingAtomicForSelfCleanupAndConstructCommandBufferIsCalledThenStillProgramTheSync) { + using WalkerType = typename FamilyType::DefaultWalkerType; + MockExecutionEnvironment mockExecutionEnvironment{}; testArgs.crossTileAtomicSynchronization = false; testArgs.tileCount = 4u; @@ -909,7 +926,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWit auto walker = createWalker(postSyncAddress); uint32_t totalBytesProgrammed{}; - const auto controlSectionOffset = computeStaticPartitioningControlSectionOffset(testArgs); + const auto controlSectionOffset = computeStaticPartitioningControlSectionOffset(testArgs); const auto preWalkerSyncAddress = cmdBufferGpuAddress + controlSectionOffset + offsetof(StaticPartitioningControlSection, synchronizeBeforeWalkerCounter); const auto postWalkerSyncAddress = cmdBufferGpuAddress + controlSectionOffset + offsetof(StaticPartitioningControlSection, synchronizeAfterWalkerCounter); const auto finalSyncAddress = cmdBufferGpuAddress + controlSectionOffset + offsetof(StaticPartitioningControlSection, finalSyncTileCounter); @@ -920,7 +937,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWit totalBytesProgrammed, testArgs, *defaultHwInfo); - const auto expectedBytesProgrammed = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); + const auto expectedBytesProgrammed = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); EXPECT_EQ(expectedBytesProgrammed, totalBytesProgrammed); auto parsedOffset = 0u; @@ -934,9 +951,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWit EXPECT_EQ(testArgs.workPartitionAllocationGpuVa, loadRegisterMem->getMemoryAddress()); } { - auto computeWalker = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); + auto computeWalker = genCmdCast(ptrOffset(cmdBuffer, parsedOffset)); ASSERT_NE(nullptr, computeWalker); - parsedOffset += sizeof(WalkerPartition::COMPUTE_WALKER); + parsedOffset += sizeof(WalkerType); } { auto miAtomic = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); @@ -1053,6 +1070,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWit } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenDebugModesForWalkerPartitionWhenConstructCommandBufferIsCalledThenBatchBufferIsBeingProgrammed) { + using WalkerType = typename FamilyType::DefaultWalkerType; + MockExecutionEnvironment mockExecutionEnvironment{}; testArgs.crossTileAtomicSynchronization = false; testArgs.semaphoreProgrammingRequired = true; @@ -1064,9 +1083,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenDebugModesForWalkerParti checkForProperCmdBufferAddressOffset = false; uint64_t gpuVirtualAddress = 0x8000123000; uint64_t postSyncAddress = 0x8000456000; - WalkerPartition::COMPUTE_WALKER walker; + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; - walker.setPartitionType(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X); + walker.setPartitionType(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X); auto &postSync = walker.getPostSync(); postSync.setOperation(POSTSYNC_DATA::OPERATION::OPERATION_WRITE_TIMESTAMP); postSync.setDestinationAddress(postSyncAddress); @@ -1078,13 +1097,14 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenDebugModesForWalkerParti sizeof(WalkerPartition::MI_SET_PREDICATE) * 2 + sizeof(WalkerPartition::BATCH_BUFFER_START) * 3 + sizeof(WalkerPartition::PIPE_CONTROL) + - sizeof(WalkerPartition::COMPUTE_WALKER) + + sizeof(WalkerType) + sizeof(WalkerPartition::MI_SEMAPHORE_WAIT) * testArgs.partitionCount; auto walkerSectionCommands = sizeof(WalkerPartition::BATCH_BUFFER_START) + - sizeof(WalkerPartition::COMPUTE_WALKER); + sizeof(WalkerType); - EXPECT_EQ(expectedCommandUsedSize, computeControlSectionOffset(testArgs)); + auto offset = computeControlSectionOffset(testArgs); + EXPECT_EQ(expectedCommandUsedSize, offset); auto optionalBatchBufferEndOffset = expectedCommandUsedSize + sizeof(BatchBufferControlData); @@ -1170,9 +1190,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenDebugModesForWalkerParti EXPECT_EQ(batchBufferStartFinal->getBatchBufferStartAddress(), gpuVirtualAddress + optionalBatchBufferEndOffset); parsedOffset += sizeof(WalkerPartition::BATCH_BUFFER_START); - auto computeWalker = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); + auto computeWalker = genCmdCast(ptrOffset(cmdBuffer, parsedOffset)); ASSERT_NE(nullptr, computeWalker); - parsedOffset += sizeof(WalkerPartition::COMPUTE_WALKER); + parsedOffset += sizeof(WalkerType); batchBufferStart = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); ASSERT_NE(nullptr, batchBufferStart); @@ -1191,6 +1211,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenDebugModesForWalkerParti } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWhenWparidRegisterProgrammingDisabledThenExpectNoMiLoadRegisterMemCommand) { + using WalkerType = typename FamilyType::DefaultWalkerType; + testArgs.tileCount = 4u; testArgs.partitionCount = testArgs.tileCount; testArgs.initializeWparidRegister = false; @@ -1206,10 +1228,10 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWhe testArgs.workPartitionAllocationGpuVa = 0x8000444000; auto walker = createWalker(postSyncAddress); - uint64_t expectedControlSectionOffset = sizeof(WalkerPartition::COMPUTE_WALKER); + uint64_t expectedControlSectionOffset = sizeof(WalkerType); uint32_t totalBytesProgrammed{}; - const auto controlSectionOffset = computeStaticPartitioningControlSectionOffset(testArgs); + const auto controlSectionOffset = computeStaticPartitioningControlSectionOffset(testArgs); EXPECT_EQ(expectedControlSectionOffset, controlSectionOffset); WalkerPartition::constructStaticallyPartitionedCommandBuffer(cmdBuffer, nullptr, @@ -1218,19 +1240,21 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWhe totalBytesProgrammed, testArgs, *defaultHwInfo); - const auto expectedBytesProgrammed = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); + const auto expectedBytesProgrammed = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); EXPECT_EQ(expectedBytesProgrammed, totalBytesProgrammed); auto parsedOffset = 0u; { - auto computeWalker = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); + auto computeWalker = genCmdCast(ptrOffset(cmdBuffer, parsedOffset)); ASSERT_NE(nullptr, computeWalker); - parsedOffset += sizeof(WalkerPartition::COMPUTE_WALKER); + parsedOffset += sizeof(WalkerType); } EXPECT_EQ(parsedOffset, totalBytesProgrammed); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWhenPipeControlProgrammingDisabledThenExpectNoPipeControlCommand) { + using WalkerType = typename FamilyType::DefaultWalkerType; + testArgs.tileCount = 4u; testArgs.partitionCount = testArgs.tileCount; testArgs.emitSelfCleanup = false; @@ -1246,10 +1270,10 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWhe auto walker = createWalker(postSyncAddress); uint64_t expectedControlSectionOffset = sizeof(WalkerPartition::LOAD_REGISTER_MEM) + - sizeof(WalkerPartition::COMPUTE_WALKER); + sizeof(WalkerType); uint32_t totalBytesProgrammed{}; - const auto controlSectionOffset = computeStaticPartitioningControlSectionOffset(testArgs); + const auto controlSectionOffset = computeStaticPartitioningControlSectionOffset(testArgs); EXPECT_EQ(expectedControlSectionOffset, controlSectionOffset); WalkerPartition::constructStaticallyPartitionedCommandBuffer(cmdBuffer, nullptr, @@ -1258,7 +1282,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWhe totalBytesProgrammed, testArgs, *defaultHwInfo); - const auto expectedBytesProgrammed = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); + const auto expectedBytesProgrammed = WalkerPartition::estimateSpaceRequiredInCommandBuffer(testArgs); EXPECT_EQ(expectedBytesProgrammed, totalBytesProgrammed); auto parsedOffset = 0u; @@ -1272,16 +1296,18 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticWalkerPartitionWhe EXPECT_EQ(testArgs.workPartitionAllocationGpuVa, loadRegisterMem->getMemoryAddress()); } { - auto computeWalker = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); + auto computeWalker = genCmdCast(ptrOffset(cmdBuffer, parsedOffset)); ASSERT_NE(nullptr, computeWalker); - parsedOffset += sizeof(WalkerPartition::COMPUTE_WALKER); + parsedOffset += sizeof(WalkerType); } EXPECT_EQ(parsedOffset, totalBytesProgrammed); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitionIsPreferredAndWalkerWithNonUniformStartWhenDynamicPartitionSelectedThenExpectReconfigureWparidToStatic) { + using WalkerType = typename FamilyType::DefaultWalkerType; + MockExecutionEnvironment mockExecutionEnvironment{}; - WalkerPartition::COMPUTE_WALKER walker; + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdStartingX(1u); @@ -1305,14 +1331,15 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitionIsPreferr sizeof(WalkerPartition::MI_SET_PREDICATE) * 2 + sizeof(WalkerPartition::BATCH_BUFFER_START) * 3 + sizeof(WalkerPartition::PIPE_CONTROL) + - sizeof(WalkerPartition::COMPUTE_WALKER) + + sizeof(WalkerType) + sizeof(WalkerPartition::MI_SEMAPHORE_WAIT) + sizeof(WalkerPartition::LOAD_REGISTER_MEM); - EXPECT_EQ(expectedCommandUsedSize, computeControlSectionOffset(testArgs)); + auto offset = computeControlSectionOffset(testArgs); + EXPECT_EQ(expectedCommandUsedSize, offset); auto walkerSectionCommands = sizeof(WalkerPartition::BATCH_BUFFER_START) + - sizeof(WalkerPartition::COMPUTE_WALKER); + sizeof(WalkerType); auto totalProgrammedSize = expectedCommandUsedSize + sizeof(BatchBufferControlData); testArgs.tileCount = 2; @@ -1404,9 +1431,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitionIsPreferr EXPECT_EQ(batchBufferStartFinal->getBatchBufferStartAddress(), gpuVirtualAddress + totalProgrammedSize); parsedOffset += sizeof(WalkerPartition::BATCH_BUFFER_START); - auto computeWalker = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); + auto computeWalker = genCmdCast(ptrOffset(cmdBuffer, parsedOffset)); ASSERT_NE(nullptr, computeWalker); - parsedOffset += sizeof(WalkerPartition::COMPUTE_WALKER); + parsedOffset += sizeof(WalkerType); batchBufferStart = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); ASSERT_NE(nullptr, batchBufferStart); 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 e92b2ede19..cc2bf97ee3 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 @@ -27,13 +27,15 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenProgramRegisterCommandWh } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerPartitionWhenConstructCommandBufferIsCalledWithoutBatchBufferEndThenBatchBufferEndIsNotProgrammed) { + using WalkerType = typename FamilyType::DefaultWalkerType; + testArgs.partitionCount = 16u; testArgs.tileCount = 4u; checkForProperCmdBufferAddressOffset = false; uint64_t gpuVirtualAddress = 0x8000123000; - WalkerPartition::COMPUTE_WALKER walker; + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; - walker.setPartitionType(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X); + walker.setPartitionType(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X); WalkerPartition::constructDynamicallyPartitionedCommandBuffer(cmdBuffer, nullptr, @@ -42,54 +44,60 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerPartitionWhenConst totalBytesProgrammed, testArgs, *defaultHwInfo); - auto totalProgrammedSize = computeControlSectionOffset(testArgs) + + auto totalProgrammedSize = computeControlSectionOffset(testArgs) + sizeof(BatchBufferControlData); EXPECT_EQ(totalProgrammedSize, totalBytesProgrammed); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenEstimationWhenItIsCalledThenProperSizeIsReturned) { + using WalkerType = typename FamilyType::DefaultWalkerType; + testArgs.partitionCount = 16u; auto expectedUsedSize = sizeof(WalkerPartition::LOAD_REGISTER_IMM) + sizeof(WalkerPartition::MI_ATOMIC) * 2 + sizeof(WalkerPartition::LOAD_REGISTER_REG) + sizeof(WalkerPartition::MI_SET_PREDICATE) * 2 + sizeof(WalkerPartition::BATCH_BUFFER_START) * 3 + - sizeof(WalkerPartition::COMPUTE_WALKER) + + sizeof(WalkerType) + sizeof(WalkerPartition::PIPE_CONTROL) + sizeof(WalkerPartition::BatchBufferControlData) + sizeof(WalkerPartition::MI_SEMAPHORE_WAIT); testArgs.emitBatchBufferEnd = false; - EXPECT_EQ(expectedUsedSize, - estimateSpaceRequiredInCommandBuffer(testArgs)); + auto size = estimateSpaceRequiredInCommandBuffer(testArgs); + EXPECT_EQ(expectedUsedSize, size); testArgs.emitBatchBufferEnd = true; - EXPECT_EQ(expectedUsedSize + sizeof(WalkerPartition::BATCH_BUFFER_END), - estimateSpaceRequiredInCommandBuffer(testArgs)); + size = estimateSpaceRequiredInCommandBuffer(testArgs); + EXPECT_EQ(expectedUsedSize + sizeof(WalkerPartition::BATCH_BUFFER_END), size); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenEstimationWhenPartitionCountIs4ThenSizeIsProperlyEstimated) { + using WalkerType = typename FamilyType::DefaultWalkerType; + testArgs.partitionCount = 4u; auto expectedUsedSize = sizeof(WalkerPartition::LOAD_REGISTER_IMM) + sizeof(WalkerPartition::MI_ATOMIC) * 2 + sizeof(WalkerPartition::LOAD_REGISTER_REG) + sizeof(WalkerPartition::MI_SET_PREDICATE) * 2 + sizeof(WalkerPartition::BATCH_BUFFER_START) * 3 + - sizeof(WalkerPartition::COMPUTE_WALKER) + + sizeof(WalkerType) + sizeof(WalkerPartition::PIPE_CONTROL) + sizeof(WalkerPartition::BatchBufferControlData) + sizeof(WalkerPartition::MI_SEMAPHORE_WAIT); testArgs.emitBatchBufferEnd = false; - EXPECT_EQ(expectedUsedSize, - estimateSpaceRequiredInCommandBuffer(testArgs)); + auto size = estimateSpaceRequiredInCommandBuffer(testArgs); + EXPECT_EQ(expectedUsedSize, size); testArgs.emitBatchBufferEnd = true; - EXPECT_EQ(expectedUsedSize + sizeof(WalkerPartition::BATCH_BUFFER_END), - estimateSpaceRequiredInCommandBuffer(testArgs)); + size = estimateSpaceRequiredInCommandBuffer(testArgs); + EXPECT_EQ(expectedUsedSize + sizeof(WalkerPartition::BATCH_BUFFER_END), size); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenEstimationAndSynchronizeBeforeExecutionWhenItIsCalledThenProperSizeIsReturned) { + using WalkerType = typename FamilyType::DefaultWalkerType; + testArgs.partitionCount = 16u; testArgs.emitBatchBufferEnd = false; auto expectedUsedSize = sizeof(WalkerPartition::LOAD_REGISTER_IMM) + @@ -97,7 +105,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenEstimationAndSynchronize sizeof(WalkerPartition::LOAD_REGISTER_REG) + sizeof(WalkerPartition::MI_SET_PREDICATE) * 2 + sizeof(WalkerPartition::BATCH_BUFFER_START) * 3 + - sizeof(WalkerPartition::COMPUTE_WALKER) + + sizeof(WalkerType) + sizeof(WalkerPartition::PIPE_CONTROL) + sizeof(WalkerPartition::BatchBufferControlData) + sizeof(WalkerPartition::MI_SEMAPHORE_WAIT); @@ -105,18 +113,20 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenEstimationAndSynchronize sizeof(WalkerPartition::MI_SEMAPHORE_WAIT); testArgs.synchronizeBeforeExecution = false; - EXPECT_EQ(expectedUsedSize, - estimateSpaceRequiredInCommandBuffer(testArgs)); + auto size = estimateSpaceRequiredInCommandBuffer(testArgs); + EXPECT_EQ(expectedUsedSize, size); testArgs.synchronizeBeforeExecution = true; - EXPECT_EQ(expectedUsedSize + expectedDelta, - estimateSpaceRequiredInCommandBuffer(testArgs)); + size = estimateSpaceRequiredInCommandBuffer(testArgs); + EXPECT_EQ(expectedUsedSize + expectedDelta, size); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitioningEstimationWhenItIsCalledThenProperSizeIsReturned) { + using WalkerType = typename FamilyType::DefaultWalkerType; + testArgs.partitionCount = 16u; const auto expectedUsedSize = sizeof(WalkerPartition::LOAD_REGISTER_MEM) + - sizeof(WalkerPartition::COMPUTE_WALKER) + + sizeof(WalkerType) + sizeof(WalkerPartition::PIPE_CONTROL) + sizeof(WalkerPartition::MI_ATOMIC) + sizeof(WalkerPartition::MI_SEMAPHORE_WAIT) + @@ -125,19 +135,22 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitioningEstima testArgs.emitBatchBufferEnd = false; testArgs.staticPartitioning = true; - EXPECT_EQ(expectedUsedSize, - estimateSpaceRequiredInCommandBuffer(testArgs)); + + auto size = estimateSpaceRequiredInCommandBuffer(testArgs); + EXPECT_EQ(expectedUsedSize, size); testArgs.emitBatchBufferEnd = true; - EXPECT_EQ(expectedUsedSize, - estimateSpaceRequiredInCommandBuffer(testArgs)); + size = estimateSpaceRequiredInCommandBuffer(testArgs); + EXPECT_EQ(expectedUsedSize, size); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitioningEstimationAndSynchronizeBeforeExecutionWhenItIsCalledThenProperSizeIsReturned) { + using WalkerType = typename FamilyType::DefaultWalkerType; + testArgs.partitionCount = 16u; testArgs.emitBatchBufferEnd = false; const auto expectedUsedSize = sizeof(WalkerPartition::LOAD_REGISTER_MEM) + - sizeof(WalkerPartition::COMPUTE_WALKER) + + sizeof(WalkerType) + sizeof(WalkerPartition::PIPE_CONTROL) + sizeof(WalkerPartition::MI_ATOMIC) + sizeof(WalkerPartition::MI_SEMAPHORE_WAIT) + @@ -146,16 +159,20 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitioningEstima testArgs.staticPartitioning = true; testArgs.synchronizeBeforeExecution = false; - EXPECT_EQ(expectedUsedSize, - estimateSpaceRequiredInCommandBuffer(testArgs)); + + auto size = estimateSpaceRequiredInCommandBuffer(testArgs); + EXPECT_EQ(expectedUsedSize, size); testArgs.synchronizeBeforeExecution = true; const auto preExecutionSynchronizationSize = sizeof(WalkerPartition::MI_ATOMIC) + sizeof(WalkerPartition::MI_SEMAPHORE_WAIT); - EXPECT_EQ(expectedUsedSize + preExecutionSynchronizationSize, - estimateSpaceRequiredInCommandBuffer(testArgs)); + + size = estimateSpaceRequiredInCommandBuffer(testArgs); + EXPECT_EQ(expectedUsedSize + preExecutionSynchronizationSize, size); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenEstimationSelfCleanupSectionsWhenItIsCalledThenProperSizeIsReturned) { + using WalkerType = typename FamilyType::DefaultWalkerType; + testArgs.partitionCount = 16u; testArgs.emitBatchBufferEnd = false; testArgs.synchronizeBeforeExecution = false; @@ -166,7 +183,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenEstimationSelfCleanupSec sizeof(WalkerPartition::LOAD_REGISTER_REG) + sizeof(WalkerPartition::MI_SET_PREDICATE) * 2 + sizeof(WalkerPartition::BATCH_BUFFER_START) * 3 + - sizeof(WalkerPartition::COMPUTE_WALKER) + + sizeof(WalkerType) + sizeof(WalkerPartition::MI_STORE_DATA_IMM) + sizeof(WalkerPartition::PIPE_CONTROL) + sizeof(WalkerPartition::BatchBufferControlData) + @@ -175,11 +192,13 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenEstimationSelfCleanupSec sizeof(WalkerPartition::MI_SEMAPHORE_WAIT) * 2 + sizeof(WalkerPartition::MI_STORE_DATA_IMM) * 3; - EXPECT_EQ(expectedUsedSize, - estimateSpaceRequiredInCommandBuffer(testArgs)); + auto size = estimateSpaceRequiredInCommandBuffer(testArgs); + EXPECT_EQ(expectedUsedSize, size); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenEstimationSelfCleanupSectionsWhenAtomicsUsedForSelfCleanupThenProperSizeIsReturned) { + using WalkerType = typename FamilyType::DefaultWalkerType; + testArgs.partitionCount = 16u; testArgs.emitBatchBufferEnd = false; testArgs.synchronizeBeforeExecution = false; @@ -191,7 +210,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenEstimationSelfCleanupSec sizeof(WalkerPartition::LOAD_REGISTER_REG) + sizeof(WalkerPartition::MI_SET_PREDICATE) * 2 + sizeof(WalkerPartition::BATCH_BUFFER_START) * 3 + - sizeof(WalkerPartition::COMPUTE_WALKER) + + sizeof(WalkerType) + sizeof(WalkerPartition::MI_ATOMIC) + sizeof(WalkerPartition::PIPE_CONTROL) + sizeof(WalkerPartition::BatchBufferControlData) + @@ -200,8 +219,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenEstimationSelfCleanupSec sizeof(WalkerPartition::MI_SEMAPHORE_WAIT) * 2 + sizeof(WalkerPartition::MI_ATOMIC) * 3; - EXPECT_EQ(expectedUsedSize, - estimateSpaceRequiredInCommandBuffer(testArgs)); + auto size = estimateSpaceRequiredInCommandBuffer(testArgs); + EXPECT_EQ(expectedUsedSize, size); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenProgramWparidPredicationMaskWhenItIsCalledWithWrongInputThenFalseIsReturnedAndNothingIsProgrammed) { @@ -396,55 +415,59 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenProgramBatchBufferStartC } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenProgramComputeWalkerWhenItIsCalledThenWalkerIsProperlyProgrammed) { - auto expectedUsedSize = sizeof(WalkerPartition::COMPUTE_WALKER); - WalkerPartition::COMPUTE_WALKER walker; + using WalkerType = typename FamilyType::DefaultWalkerType; + + auto expectedUsedSize = sizeof(WalkerType); + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdXDimension(7u); walker.setThreadGroupIdYDimension(10u); walker.setThreadGroupIdZDimension(11u); - walker.setPartitionType(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X); + walker.setPartitionType(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X); void *walkerCommandAddress = cmdBufferAddress; programPartitionedWalker(cmdBufferAddress, totalBytesProgrammed, &walker, 2u, false); - auto walkerCommand = genCmdCast *>(walkerCommandAddress); + auto walkerCommand = genCmdCast(walkerCommandAddress); ASSERT_NE(nullptr, walkerCommand); EXPECT_EQ(expectedUsedSize, totalBytesProgrammed); EXPECT_TRUE(walkerCommand->getWorkloadPartitionEnable()); - EXPECT_EQ(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X, walkerCommand->getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X, walkerCommand->getPartitionType()); EXPECT_EQ(4u, walkerCommand->getPartitionSize()); - walker.setPartitionType(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Y); + walker.setPartitionType(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Y); walkerCommandAddress = cmdBufferAddress; programPartitionedWalker(cmdBufferAddress, totalBytesProgrammed, &walker, 2u, false); - walkerCommand = genCmdCast *>(walkerCommandAddress); + walkerCommand = genCmdCast(walkerCommandAddress); ASSERT_NE(nullptr, walkerCommand); - EXPECT_EQ(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Y, walkerCommand->getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Y, walkerCommand->getPartitionType()); EXPECT_EQ(5u, walkerCommand->getPartitionSize()); - walker.setPartitionType(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Z); + walker.setPartitionType(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Z); walkerCommandAddress = cmdBufferAddress; programPartitionedWalker(cmdBufferAddress, totalBytesProgrammed, &walker, 2u, false); - walkerCommand = genCmdCast *>(walkerCommandAddress); + walkerCommand = genCmdCast(walkerCommandAddress); ASSERT_NE(nullptr, walkerCommand); - EXPECT_EQ(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Z, walkerCommand->getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Z, walkerCommand->getPartitionType()); EXPECT_EQ(6u, walkerCommand->getPartitionSize()); // if we program with partition Count == 1 then do not trigger partition stuff - walker.setPartitionType(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_DISABLED); + walker.setPartitionType(WalkerType::PARTITION_TYPE::PARTITION_TYPE_DISABLED); walkerCommandAddress = cmdBufferAddress; programPartitionedWalker(cmdBufferAddress, totalBytesProgrammed, &walker, 1u, false); - walkerCommand = genCmdCast *>(walkerCommandAddress); + walkerCommand = genCmdCast(walkerCommandAddress); ASSERT_NE(nullptr, walkerCommand); EXPECT_EQ(0u, walkerCommand->getPartitionSize()); EXPECT_FALSE(walkerCommand->getWorkloadPartitionEnable()); - EXPECT_EQ(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_DISABLED, walkerCommand->getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_DISABLED, walkerCommand->getPartitionType()); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerWhenComputePartitionCountIsCalledThenDefaultSizeAndTypeIsReturned) { - WalkerPartition::COMPUTE_WALKER walker; + using WalkerType = typename FamilyType::DefaultWalkerType; + + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdXDimension(16u); @@ -452,11 +475,13 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerWhenComputePartiti auto partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 2u, false, &staticPartitioning); EXPECT_FALSE(staticPartitioning); EXPECT_EQ(2u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X, walker.getPartitionType()); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerWithNonUniformStartWhenComputePartitionCountIsCalledThenPartitionsAreDisabled) { - WalkerPartition::COMPUTE_WALKER walker; + using WalkerType = typename FamilyType::DefaultWalkerType; + + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdStartingX(1u); @@ -464,7 +489,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerWithNonUniformStar auto partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, false, &staticPartitioning); EXPECT_FALSE(staticPartitioning); EXPECT_EQ(1u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_DISABLED, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_DISABLED, walker.getPartitionType()); walker.setThreadGroupIdStartingX(0u); walker.setThreadGroupIdStartingY(1u); @@ -472,7 +497,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerWithNonUniformStar partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, false, &staticPartitioning); EXPECT_FALSE(staticPartitioning); EXPECT_EQ(1u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_DISABLED, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_DISABLED, walker.getPartitionType()); walker.setThreadGroupIdStartingY(0u); walker.setThreadGroupIdStartingZ(1u); @@ -480,11 +505,13 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerWithNonUniformStar partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, false, &staticPartitioning); EXPECT_FALSE(staticPartitioning); EXPECT_EQ(1u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_DISABLED, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_DISABLED, walker.getPartitionType()); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerWithDifferentWorkgroupCountsWhenPartitionCountIsObtainedThenHighestDimensionIsPartitioned) { - WalkerPartition::COMPUTE_WALKER walker; + using WalkerType = typename FamilyType::DefaultWalkerType; + + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdXDimension(64u); walker.setThreadGroupIdYDimension(64u); @@ -494,25 +521,27 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerWithDifferentWorkg auto partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, false, &staticPartitioning); EXPECT_FALSE(staticPartitioning); EXPECT_EQ(4u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X, walker.getPartitionType()); walker.setThreadGroupIdYDimension(65u); - walker.setPartitionType(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_DISABLED); + walker.setPartitionType(WalkerType::PARTITION_TYPE::PARTITION_TYPE_DISABLED); partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, false, &staticPartitioning); EXPECT_FALSE(staticPartitioning); EXPECT_EQ(4u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Y, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Y, walker.getPartitionType()); walker.setThreadGroupIdZDimension(66u); - walker.setPartitionType(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_DISABLED); + walker.setPartitionType(WalkerType::PARTITION_TYPE::PARTITION_TYPE_DISABLED); partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, false, &staticPartitioning); EXPECT_FALSE(staticPartitioning); EXPECT_EQ(4u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Z, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Z, walker.getPartitionType()); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenDisabledMinimalPartitionSizeWhenComputePartitionSizeThenProperValueIsReturned) { - WalkerPartition::COMPUTE_WALKER walker; + using WalkerType = typename FamilyType::DefaultWalkerType; + + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdXDimension(64u); walker.setThreadGroupIdYDimension(64u); @@ -525,25 +554,27 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenDisabledMinimalPartition auto partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, false, &staticPartitioning); EXPECT_FALSE(staticPartitioning); EXPECT_EQ(16u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X, walker.getPartitionType()); walker.setThreadGroupIdYDimension(65u); - walker.setPartitionType(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_DISABLED); + walker.setPartitionType(WalkerType::PARTITION_TYPE::PARTITION_TYPE_DISABLED); partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, false, &staticPartitioning); EXPECT_FALSE(staticPartitioning); EXPECT_EQ(16u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Y, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Y, walker.getPartitionType()); walker.setThreadGroupIdZDimension(66u); - walker.setPartitionType(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_DISABLED); + walker.setPartitionType(WalkerType::PARTITION_TYPE::PARTITION_TYPE_DISABLED); partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, false, &staticPartitioning); EXPECT_FALSE(staticPartitioning); EXPECT_EQ(16u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Z, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Z, walker.getPartitionType()); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerWithDifferentWorkgroupCountsWhenPartitionCountIsObtainedThenPartitionCountIsClampedToHighestDimension) { - WalkerPartition::COMPUTE_WALKER walker; + using WalkerType = typename FamilyType::DefaultWalkerType; + + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdXDimension(15u); walker.setThreadGroupIdYDimension(7u); @@ -553,28 +584,30 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerWithDifferentWorkg auto partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, false, &staticPartitioning); EXPECT_FALSE(staticPartitioning); EXPECT_EQ(4u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X, walker.getPartitionType()); walker.setThreadGroupIdXDimension(1u); - walker.setPartitionType(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_DISABLED); + walker.setPartitionType(WalkerType::PARTITION_TYPE::PARTITION_TYPE_DISABLED); partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, false, &staticPartitioning); EXPECT_FALSE(staticPartitioning); EXPECT_EQ(4u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Y, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Y, walker.getPartitionType()); walker.setThreadGroupIdYDimension(1u); - walker.setPartitionType(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_DISABLED); + walker.setPartitionType(WalkerType::PARTITION_TYPE::PARTITION_TYPE_DISABLED); partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, false, &staticPartitioning); EXPECT_FALSE(staticPartitioning); EXPECT_EQ(4u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Z, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Z, walker.getPartitionType()); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerWithPartitionTypeHintWhenPartitionCountIsObtainedThenSuggestedTypeIsUsedForPartition) { + using WalkerType = typename FamilyType::DefaultWalkerType; + DebugManagerStateRestore restore{}; - WalkerPartition::COMPUTE_WALKER walker; + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdXDimension(8u); walker.setThreadGroupIdYDimension(4u); @@ -585,31 +618,33 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerWithPartitionTypeH auto partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, false, &staticPartitioning); EXPECT_FALSE(staticPartitioning); EXPECT_EQ(4u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X, walker.getPartitionType()); - debugManager.flags.ExperimentalSetWalkerPartitionType.set(static_cast(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X)); + debugManager.flags.ExperimentalSetWalkerPartitionType.set(static_cast(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X)); partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, false, &staticPartitioning); EXPECT_FALSE(staticPartitioning); EXPECT_EQ(4u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X, walker.getPartitionType()); - debugManager.flags.ExperimentalSetWalkerPartitionType.set(static_cast(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Y)); + debugManager.flags.ExperimentalSetWalkerPartitionType.set(static_cast(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Y)); partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, false, &staticPartitioning); EXPECT_FALSE(staticPartitioning); EXPECT_EQ(4u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Y, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Y, walker.getPartitionType()); - debugManager.flags.ExperimentalSetWalkerPartitionType.set(static_cast(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Z)); + debugManager.flags.ExperimentalSetWalkerPartitionType.set(static_cast(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Z)); partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, false, &staticPartitioning); EXPECT_FALSE(staticPartitioning); EXPECT_EQ(2u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Z, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Z, walker.getPartitionType()); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenInvalidPartitionTypeIsRequestedWhenPartitionCountIsObtainedThenFail) { + using WalkerType = typename FamilyType::DefaultWalkerType; + DebugManagerStateRestore restore{}; - WalkerPartition::COMPUTE_WALKER walker; + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdXDimension(8u); walker.setThreadGroupIdYDimension(4u); @@ -621,7 +656,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenInvalidPartitionTypeIsRe } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerWithSmallXDimensionSizeWhenPartitionCountIsObtainedThenPartitionCountIsAdujsted) { - WalkerPartition::COMPUTE_WALKER walker; + using WalkerType = typename FamilyType::DefaultWalkerType; + + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdXDimension(32u); walker.setThreadGroupIdYDimension(1024u); @@ -631,11 +668,13 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerWithSmallXDimensio auto partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 2u, false, &staticPartitioning); EXPECT_FALSE(staticPartitioning); EXPECT_EQ(2u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Y, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Y, walker.getPartitionType()); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerWithBigXDimensionSizeWhenPartitionCountIsObtainedThenPartitionCountIsNotAdjusted) { - WalkerPartition::COMPUTE_WALKER walker; + using WalkerType = typename FamilyType::DefaultWalkerType; + + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdXDimension(16384u); walker.setThreadGroupIdYDimension(1u); @@ -645,11 +684,13 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerWithBigXDimensionS auto partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 2u, false, &staticPartitioning); EXPECT_FALSE(staticPartitioning); EXPECT_EQ(16u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X, walker.getPartitionType()); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenCustomMinimalPartitionSizeWhenComputePartitionCountThenProperValueIsReturned) { - WalkerPartition::COMPUTE_WALKER walker; + using WalkerType = typename FamilyType::DefaultWalkerType; + + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdXDimension(16384u); walker.setThreadGroupIdYDimension(1u); @@ -662,11 +703,13 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenCustomMinimalPartitionSi auto partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 2u, false, &staticPartitioning); EXPECT_FALSE(staticPartitioning); EXPECT_EQ(4u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X, walker.getPartitionType()); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerWithPartitionTypeProgrammedWhenPartitionCountIsObtainedAndItEqualsOneThenPartitionMechanismIsDisabled) { - WalkerPartition::COMPUTE_WALKER walker; + using WalkerType = typename FamilyType::DefaultWalkerType; + using WalkerType = typename FamilyType::DefaultWalkerType; + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdXDimension(1u); walker.setThreadGroupIdYDimension(1u); @@ -676,11 +719,12 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenWalkerWithPartitionTypeP auto partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, false, &staticPartitioning); EXPECT_FALSE(staticPartitioning); EXPECT_EQ(1u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_DISABLED, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_DISABLED, walker.getPartitionType()); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenXDimensionIsNotLargetAnd2DImagesAreUsedWhenPartitionTypeIsObtainedThenSelectXDimension) { - WalkerPartition::COMPUTE_WALKER walker; + using WalkerType = typename FamilyType::DefaultWalkerType; + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdXDimension(8u); walker.setThreadGroupIdYDimension(64u); @@ -688,14 +732,15 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenXDimensionIsNotLargetAnd bool staticPartitioning = false; auto partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, false, &staticPartitioning); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Y, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Y, walker.getPartitionType()); partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::x, 4u, false, &staticPartitioning); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X, walker.getPartitionType()); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitioningAndNonPartitionableWalkerWhenPartitionCountIsObtainedThenAllowPartitioning) { - WalkerPartition::COMPUTE_WALKER walker; + using WalkerType = typename FamilyType::DefaultWalkerType; + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdXDimension(1u); walker.setThreadGroupIdYDimension(1u); @@ -705,11 +750,12 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitioningAndNon auto partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::x, 4u, true, &staticPartitioning); EXPECT_TRUE(staticPartitioning); EXPECT_EQ(4u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X, walker.getPartitionType()); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitioningAndPartitionableWalkerWhenPartitionCountIsObtainedThenAllowPartitioning) { - WalkerPartition::COMPUTE_WALKER walker; + using WalkerType = typename FamilyType::DefaultWalkerType; + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdXDimension(1u); walker.setThreadGroupIdYDimension(2u); @@ -719,11 +765,12 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitioningAndPar auto partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, true, &staticPartitioning); EXPECT_TRUE(staticPartitioning); EXPECT_EQ(4u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Y, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Y, walker.getPartitionType()); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitioningAndBigPartitionCountProgrammedInWalkerWhenPartitionCountIsObtainedThenNumberOfPartitionsIsEqualToNumberOfTiles) { - WalkerPartition::COMPUTE_WALKER walker; + using WalkerType = typename FamilyType::DefaultWalkerType; + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdXDimension(1u); walker.setThreadGroupIdYDimension(16384u); @@ -733,11 +780,12 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitioningAndBig auto partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, true, &staticPartitioning); EXPECT_TRUE(staticPartitioning); EXPECT_EQ(4u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Y, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Y, walker.getPartitionType()); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitioningAndAndNonUniformStartProgrammedInWalkerWhenPartitionCountIsObtainedThenDoNotAllowStaticPartitioningAndSetPartitionCountToOne) { - WalkerPartition::COMPUTE_WALKER walker; + using WalkerType = typename FamilyType::DefaultWalkerType; + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdXDimension(1u); walker.setThreadGroupIdYDimension(16384u); @@ -750,12 +798,13 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitioningAndAnd auto partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, true, &staticPartitioning); EXPECT_FALSE(staticPartitioning); EXPECT_EQ(1u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_DISABLED, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_DISABLED, walker.getPartitionType()); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitioningAndPartitionTypeHintIsUsedWhenPartitionCountIsObtainedThenUseRequestedPartitionType) { + using WalkerType = typename FamilyType::DefaultWalkerType; DebugManagerStateRestore restore{}; - WalkerPartition::COMPUTE_WALKER walker; + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdXDimension(1u); walker.setThreadGroupIdYDimension(16384u); @@ -765,19 +814,20 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitioningAndPar auto partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, true, &staticPartitioning); EXPECT_TRUE(staticPartitioning); EXPECT_EQ(4u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Y, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Y, walker.getPartitionType()); - debugManager.flags.ExperimentalSetWalkerPartitionType.set(static_cast(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Z)); + debugManager.flags.ExperimentalSetWalkerPartitionType.set(static_cast(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Z)); staticPartitioning = false; partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 4u, true, &staticPartitioning); EXPECT_TRUE(staticPartitioning); EXPECT_EQ(4u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Z, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Z, walker.getPartitionType()); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitioningWhenZDimensionIsNotDivisibleByTwoButIsAboveThreasholThenItIsSelected) { + using WalkerType = typename FamilyType::DefaultWalkerType; DebugManagerStateRestore restore{}; - WalkerPartition::COMPUTE_WALKER walker; + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdXDimension(1u); walker.setThreadGroupIdYDimension(16384u); @@ -787,19 +837,20 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitioningWhenZD auto partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 2u, true, &staticPartitioning); EXPECT_TRUE(staticPartitioning); EXPECT_EQ(2u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Z, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Z, walker.getPartitionType()); debugManager.flags.WalkerPartitionPreferHighestDimension.set(0); partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 2u, true, &staticPartitioning); EXPECT_TRUE(staticPartitioning); EXPECT_EQ(2u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Y, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Y, walker.getPartitionType()); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitioningWhenYDimensionIsDivisibleByTwoThenItIsSelected) { + using WalkerType = typename FamilyType::DefaultWalkerType; DebugManagerStateRestore restore{}; - WalkerPartition::COMPUTE_WALKER walker; + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdXDimension(16384u); walker.setThreadGroupIdYDimension(2u); @@ -809,19 +860,20 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitioningWhenYD auto partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 2u, true, &staticPartitioning); EXPECT_TRUE(staticPartitioning); EXPECT_EQ(2u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Y, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Y, walker.getPartitionType()); debugManager.flags.WalkerPartitionPreferHighestDimension.set(0); partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 2u, true, &staticPartitioning); EXPECT_TRUE(staticPartitioning); EXPECT_EQ(2u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X, walker.getPartitionType()); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitioningWhenZDimensionIsDivisibleByTwoThenItIsSelected) { + using WalkerType = typename FamilyType::DefaultWalkerType; DebugManagerStateRestore restore{}; - WalkerPartition::COMPUTE_WALKER walker; + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdXDimension(512u); walker.setThreadGroupIdYDimension(512u); @@ -831,17 +883,18 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenStaticPartitioningWhenZD auto partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 2u, true, &staticPartitioning); EXPECT_TRUE(staticPartitioning); EXPECT_EQ(2u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Z, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Z, walker.getPartitionType()); debugManager.flags.WalkerPartitionPreferHighestDimension.set(0); partitionCount = computePartitionCountAndSetPartitionType(&walker, NEO::RequiredPartitionDim::none, 2u, true, &staticPartitioning); EXPECT_TRUE(staticPartitioning); EXPECT_EQ(2u, partitionCount); - EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_Z, walker.getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_Z, walker.getPartitionType()); } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenSelfCleanupSectionWhenDebugForceDisableCrossTileSyncThenSelfCleanupOverridesDebugAndAddsOwnCleanupSection) { + using WalkerType = typename FamilyType::DefaultWalkerType; MockExecutionEnvironment mockExecutionEnvironment{}; testArgs.crossTileAtomicSynchronization = false; @@ -852,9 +905,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenSelfCleanupSectionWhenDe testArgs.emitSelfCleanup = true; uint64_t gpuVirtualAddress = 0x8000123000; uint64_t postSyncAddress = 0x8000456000; - WalkerPartition::COMPUTE_WALKER walker; + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; - walker.setPartitionType(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X); + walker.setPartitionType(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X); auto &postSync = walker.getPostSync(); postSync.setOperation(POSTSYNC_DATA::OPERATION::OPERATION_WRITE_TIMESTAMP); postSync.setDestinationAddress(postSyncAddress); @@ -866,14 +919,15 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenSelfCleanupSectionWhenDe sizeof(WalkerPartition::MI_SET_PREDICATE) * 2 + sizeof(WalkerPartition::BATCH_BUFFER_START) * 3 + sizeof(WalkerPartition::PIPE_CONTROL) + - sizeof(WalkerPartition::COMPUTE_WALKER) + + sizeof(WalkerType) + sizeof(WalkerPartition::MI_SEMAPHORE_WAIT) + sizeof(WalkerPartition::MI_STORE_DATA_IMM); auto walkerSectionCommands = sizeof(WalkerPartition::BATCH_BUFFER_START) + - sizeof(WalkerPartition::COMPUTE_WALKER); + sizeof(WalkerType); - EXPECT_EQ(expectedCommandUsedSize, computeControlSectionOffset(testArgs)); + auto offset = computeControlSectionOffset(testArgs); + EXPECT_EQ(expectedCommandUsedSize, offset); auto cleanupSectionOffset = expectedCommandUsedSize + sizeof(BatchBufferControlData); @@ -975,9 +1029,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenSelfCleanupSectionWhenDe EXPECT_EQ(batchBufferStartFinal->getBatchBufferStartAddress(), gpuVirtualAddress + cleanupSectionOffset); parsedOffset += sizeof(WalkerPartition::BATCH_BUFFER_START); - auto computeWalker = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); + auto computeWalker = genCmdCast(ptrOffset(cmdBuffer, parsedOffset)); EXPECT_NE(nullptr, computeWalker); - parsedOffset += sizeof(WalkerPartition::COMPUTE_WALKER); + parsedOffset += sizeof(WalkerType); batchBufferStart = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); ASSERT_NE(nullptr, batchBufferStart); @@ -1048,6 +1102,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenSelfCleanupSectionWhenDe } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenSelfCleanupAndAtomicsUsedForCleanupWhenDebugForceDisableCrossTileSyncThenSelfCleanupOverridesDebugAndAddsOwnCleanupSection) { + using WalkerType = typename FamilyType::DefaultWalkerType; MockExecutionEnvironment mockExecutionEnvironment{}; testArgs.crossTileAtomicSynchronization = false; @@ -1059,9 +1114,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenSelfCleanupAndAtomicsUse uint64_t gpuVirtualAddress = 0x8000123000; uint64_t postSyncAddress = 0x8000456000; - WalkerPartition::COMPUTE_WALKER walker; + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; - walker.setPartitionType(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X); + walker.setPartitionType(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X); auto &postSync = walker.getPostSync(); postSync.setOperation(POSTSYNC_DATA::OPERATION::OPERATION_WRITE_TIMESTAMP); postSync.setDestinationAddress(postSyncAddress); @@ -1073,14 +1128,15 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenSelfCleanupAndAtomicsUse sizeof(WalkerPartition::MI_SET_PREDICATE) * 2 + sizeof(WalkerPartition::BATCH_BUFFER_START) * 3 + sizeof(WalkerPartition::PIPE_CONTROL) + - sizeof(WalkerPartition::COMPUTE_WALKER) + + sizeof(WalkerType) + sizeof(WalkerPartition::MI_SEMAPHORE_WAIT) + sizeof(WalkerPartition::MI_ATOMIC); auto walkerSectionCommands = sizeof(WalkerPartition::BATCH_BUFFER_START) + - sizeof(WalkerPartition::COMPUTE_WALKER); + sizeof(WalkerType); - EXPECT_EQ(expectedCommandUsedSize, computeControlSectionOffset(testArgs)); + auto offset = computeControlSectionOffset(testArgs); + EXPECT_EQ(expectedCommandUsedSize, offset); auto cleanupSectionOffset = expectedCommandUsedSize + sizeof(BatchBufferControlData); @@ -1183,9 +1239,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenSelfCleanupAndAtomicsUse EXPECT_EQ(batchBufferStartFinal->getBatchBufferStartAddress(), gpuVirtualAddress + cleanupSectionOffset); parsedOffset += sizeof(WalkerPartition::BATCH_BUFFER_START); - auto computeWalker = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); + auto computeWalker = genCmdCast(ptrOffset(cmdBuffer, parsedOffset)); EXPECT_NE(nullptr, computeWalker); - parsedOffset += sizeof(WalkerPartition::COMPUTE_WALKER); + parsedOffset += sizeof(WalkerType); batchBufferStart = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); ASSERT_NE(nullptr, batchBufferStart); @@ -1262,6 +1318,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenSelfCleanupAndAtomicsUse } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenDynamicPartitioningWhenPipeControlProgrammingDisabledThenExpectNoPipeControlCommand) { + using WalkerType = typename FamilyType::DefaultWalkerType; testArgs.crossTileAtomicSynchronization = false; testArgs.partitionCount = 16u; testArgs.tileCount = 4u; @@ -1272,9 +1329,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenDynamicPartitioningWhenP checkForProperCmdBufferAddressOffset = false; uint64_t gpuVirtualAddress = 0x8000123000; uint64_t postSyncAddress = 0x8000456000; - WalkerPartition::COMPUTE_WALKER walker; + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; - walker.setPartitionType(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X); + walker.setPartitionType(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X); auto &postSync = walker.getPostSync(); postSync.setOperation(POSTSYNC_DATA::OPERATION::OPERATION_WRITE_TIMESTAMP); postSync.setDestinationAddress(postSyncAddress); @@ -1285,12 +1342,13 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenDynamicPartitioningWhenP sizeof(WalkerPartition::LOAD_REGISTER_REG) + sizeof(WalkerPartition::MI_SET_PREDICATE) * 2 + sizeof(WalkerPartition::BATCH_BUFFER_START) * 3 + - sizeof(WalkerPartition::COMPUTE_WALKER); + sizeof(WalkerType); auto walkerSectionCommands = sizeof(WalkerPartition::BATCH_BUFFER_START) + - sizeof(WalkerPartition::COMPUTE_WALKER); + sizeof(WalkerType); - EXPECT_EQ(expectedCommandUsedSize, computeControlSectionOffset(testArgs)); + auto offset = computeControlSectionOffset(testArgs); + EXPECT_EQ(expectedCommandUsedSize, offset); auto cleanupSectionOffset = expectedCommandUsedSize + sizeof(BatchBufferControlData); @@ -1358,9 +1416,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenDynamicPartitioningWhenP EXPECT_EQ(batchBufferStartFinal->getBatchBufferStartAddress(), gpuVirtualAddress + cleanupSectionOffset); parsedOffset += sizeof(WalkerPartition::BATCH_BUFFER_START); - auto computeWalker = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); + auto computeWalker = genCmdCast(ptrOffset(cmdBuffer, parsedOffset)); EXPECT_NE(nullptr, computeWalker); - parsedOffset += sizeof(WalkerPartition::COMPUTE_WALKER); + parsedOffset += sizeof(WalkerType); batchBufferStart = genCmdCast *>(ptrOffset(cmdBuffer, parsedOffset)); ASSERT_NE(nullptr, batchBufferStart); @@ -1690,30 +1748,31 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenBarrierProgrammingWhenEm } HWCMDTEST_F(IGFX_XE_HP_CORE, WalkerPartitionTests, givenForceExecutionOnSingleTileWhenProgramComputeWalkerThenWalkerIsProperlyProgrammed) { - WalkerPartition::COMPUTE_WALKER walker; + using WalkerType = typename FamilyType::DefaultWalkerType; + WalkerType walker; walker = FamilyType::cmdInitGpgpuWalker; walker.setThreadGroupIdXDimension(32u); walker.setThreadGroupIdYDimension(1u); walker.setThreadGroupIdZDimension(1u); bool forceExecutionOnSingleTile = false; - walker.setPartitionType(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X); + walker.setPartitionType(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X); void *walkerCommandAddress = cmdBufferAddress; programPartitionedWalker(cmdBufferAddress, totalBytesProgrammed, &walker, 2u, forceExecutionOnSingleTile); - auto walkerCommand = genCmdCast *>(walkerCommandAddress); + auto walkerCommand = genCmdCast(walkerCommandAddress); ASSERT_NE(nullptr, walkerCommand); EXPECT_TRUE(walkerCommand->getWorkloadPartitionEnable()); - EXPECT_EQ(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X, walkerCommand->getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X, walkerCommand->getPartitionType()); EXPECT_EQ(16u, walkerCommand->getPartitionSize()); forceExecutionOnSingleTile = true; walkerCommandAddress = cmdBufferAddress; programPartitionedWalker(cmdBufferAddress, totalBytesProgrammed, &walker, 2u, forceExecutionOnSingleTile); - walkerCommand = genCmdCast *>(walkerCommandAddress); + walkerCommand = genCmdCast(walkerCommandAddress); ASSERT_NE(nullptr, walkerCommand); EXPECT_TRUE(walkerCommand->getWorkloadPartitionEnable()); - EXPECT_EQ(COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X, walkerCommand->getPartitionType()); + EXPECT_EQ(WalkerType::PARTITION_TYPE::PARTITION_TYPE_X, walkerCommand->getPartitionType()); EXPECT_EQ(32u, walkerCommand->getPartitionSize()); }