From c35f560971d2cb377b770ecccd829cd1bc86d0ef Mon Sep 17 00:00:00 2001 From: Zbigniew Zdanowicz Date: Wed, 10 Feb 2021 23:01:10 +0000 Subject: [PATCH] Refactor internal interface Related-To: NEO-5244 Signed-off-by: Zbigniew Zdanowicz --- .../core/source/cmdlist/cmdlist_hw_base.inl | 5 +- .../command_container/command_encoder.h | 3 +- .../command_encoder_bdw_plus.inl | 5 +- .../gen11/hw_cmds_generated_gen11.inl | 3 +- .../gen12lp/hw_cmds_generated_gen12lp.inl | 3 +- .../generated/gen8/hw_cmds_generated_gen8.inl | 3 +- .../generated/gen9/hw_cmds_generated_gen9.inl | 3 +- .../encoders/test_encode_dispatch_kernel.cpp | 143 +++++++++++++----- 8 files changed, 122 insertions(+), 46 deletions(-) diff --git a/level_zero/core/source/cmdlist/cmdlist_hw_base.inl b/level_zero/core/source/cmdlist/cmdlist_hw_base.inl index 6d2abd4a2d..602bda6c62 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw_base.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw_base.inl @@ -79,7 +79,7 @@ ze_result_t CommandListCoreFamily::appendLaunchKernelWithParams(z KernelImp *kernelImp = static_cast(kernel); this->containsStatelessUncachedResource |= kernelImp->getKernelRequiresUncachedMocs(); - + uint32_t partitionCount = 0; NEO::EncodeDispatchKernel::encode(commandContainer, reinterpret_cast(pThreadGroupDimensions), isIndirect, @@ -88,7 +88,8 @@ ze_result_t CommandListCoreFamily::appendLaunchKernelWithParams(z 0, device->getNEODevice(), commandListPreemptionMode, - this->containsStatelessUncachedResource); + this->containsStatelessUncachedResource, + partitionCount); if (device->getNEODevice()->getDebugger()) { auto *ssh = commandContainer.getIndirectHeap(NEO::HeapType::SURFACE_STATE); diff --git a/shared/source/command_container/command_encoder.h b/shared/source/command_container/command_encoder.h index b84cd2873d..b06d5b6b94 100644 --- a/shared/source/command_container/command_encoder.h +++ b/shared/source/command_container/command_encoder.h @@ -37,7 +37,8 @@ struct EncodeDispatchKernel { uint64_t eventAddress, Device *device, PreemptionMode preemptionMode, - bool &requiresUncachedMocs); + bool &requiresUncachedMocs, + uint32_t &partitionCount); static void encodeAdditionalWalkerFields(const HardwareInfo &hwInfo, WALKER_TYPE &walkerCmd); diff --git a/shared/source/command_container/command_encoder_bdw_plus.inl b/shared/source/command_container/command_encoder_bdw_plus.inl index 66001d9f66..71e859c7a6 100644 --- a/shared/source/command_container/command_encoder_bdw_plus.inl +++ b/shared/source/command_container/command_encoder_bdw_plus.inl @@ -25,7 +25,8 @@ namespace NEO { template void EncodeDispatchKernel::encode(CommandContainer &container, const void *pThreadGroupDimensions, bool isIndirect, bool isPredicate, DispatchKernelEncoderI *dispatchInterface, - uint64_t eventAddress, Device *device, PreemptionMode preemptionMode, bool &requiresUncachedMocs) { + uint64_t eventAddress, Device *device, PreemptionMode preemptionMode, bool &requiresUncachedMocs, + uint32_t &partitionCount) { using MEDIA_STATE_FLUSH = typename Family::MEDIA_STATE_FLUSH; using MEDIA_INTERFACE_DESCRIPTOR_LOAD = typename Family::MEDIA_INTERFACE_DESCRIPTOR_LOAD; @@ -215,6 +216,8 @@ void EncodeDispatchKernel::encode(CommandContainer &container, auto mediaStateFlush = listCmdBufferStream->getSpace(sizeof(MEDIA_STATE_FLUSH)); *reinterpret_cast(mediaStateFlush) = Family::cmdInitMediaStateFlush; } + + partitionCount = 1; } template diff --git a/shared/source/generated/gen11/hw_cmds_generated_gen11.inl b/shared/source/generated/gen11/hw_cmds_generated_gen11.inl index 1168ccb80e..59074b7b22 100644 --- a/shared/source/generated/gen11/hw_cmds_generated_gen11.inl +++ b/shared/source/generated/gen11/hw_cmds_generated_gen11.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Intel Corporation + * Copyright (C) 2018-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -867,6 +867,7 @@ typedef struct tagMI_ATOMIC { MEMORYADDRESS_INDEX = 0x1, } PATCH_CONSTANTS; typedef enum tagATOMIC_OPCODES { + ATOMIC_4B_MOVE = 0x4, ATOMIC_4B_INCREMENT = 0x5, ATOMIC_4B_DECREMENT = 0x6, ATOMIC_8B_INCREMENT = 0x25, diff --git a/shared/source/generated/gen12lp/hw_cmds_generated_gen12lp.inl b/shared/source/generated/gen12lp/hw_cmds_generated_gen12lp.inl index 1b9e0de323..b17aac5965 100644 --- a/shared/source/generated/gen12lp/hw_cmds_generated_gen12lp.inl +++ b/shared/source/generated/gen12lp/hw_cmds_generated_gen12lp.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2020 Intel Corporation + * Copyright (C) 2019-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -904,6 +904,7 @@ typedef struct tagMI_ATOMIC { COMMAND_TYPE_MI_COMMAND = 0x0, } COMMAND_TYPE; typedef enum tagATOMIC_OPCODES { + ATOMIC_4B_MOVE = 0x4, ATOMIC_4B_INCREMENT = 0x5, ATOMIC_4B_DECREMENT = 0x6, ATOMIC_8B_INCREMENT = 0x25, diff --git a/shared/source/generated/gen8/hw_cmds_generated_gen8.inl b/shared/source/generated/gen8/hw_cmds_generated_gen8.inl index 90df5a681b..d002ccae81 100644 --- a/shared/source/generated/gen8/hw_cmds_generated_gen8.inl +++ b/shared/source/generated/gen8/hw_cmds_generated_gen8.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2020 Intel Corporation + * Copyright (C) 2017-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -1005,6 +1005,7 @@ typedef struct tagMI_ATOMIC { MEMORYADDRESS_INDEX = 0x1, } PATCH_CONSTANTS; typedef enum tagATOMIC_OPCODES { + ATOMIC_4B_MOVE = 0x4, ATOMIC_4B_INCREMENT = 0x5, ATOMIC_4B_DECREMENT = 0x6, ATOMIC_8B_INCREMENT = 0x25, diff --git a/shared/source/generated/gen9/hw_cmds_generated_gen9.inl b/shared/source/generated/gen9/hw_cmds_generated_gen9.inl index 56d26aa588..cc83427487 100644 --- a/shared/source/generated/gen9/hw_cmds_generated_gen9.inl +++ b/shared/source/generated/gen9/hw_cmds_generated_gen9.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2020 Intel Corporation + * Copyright (C) 2017-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -1002,6 +1002,7 @@ typedef struct tagMI_ATOMIC { MEMORYADDRESS_INDEX = 0x1, } PATCH_CONSTANTS; typedef enum tagATOMIC_OPCODES { + ATOMIC_4B_MOVE = 0x4, ATOMIC_4B_INCREMENT = 0x5, ATOMIC_4B_DECREMENT = 0x6, ATOMIC_8B_INCREMENT = 0x25, diff --git a/shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp b/shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp index 79cd938e61..645b2caf44 100644 --- a/shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp +++ b/shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp @@ -47,7 +47,9 @@ HWTEST_F(CommandEncodeStatesTest, givenenDispatchInterfaceWhenDispatchKernelThen uint32_t dims[] = {2, 1, 1}; std::unique_ptr dispatchInterface(new MockDispatchKernelEncoder()); bool requiresUncachedMocs = false; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); GenCmdList commands; CmdParse::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); @@ -67,6 +69,7 @@ HWTEST_F(CommandEncodeStatesUncachedMocsTests, whenEncodingDispatchKernelWithUnc std::unique_ptr dispatchInterface(new MockDispatchKernelEncoder()); cmdContainer->setDirtyStateForAllHeaps(true); bool requiresUncachedMocs = true; + uint32_t partitionCount = 0; EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, @@ -75,7 +78,8 @@ HWTEST_F(CommandEncodeStatesUncachedMocsTests, whenEncodingDispatchKernelWithUnc 0, pDevice, NEO::PreemptionMode::Disabled, - requiresUncachedMocs); + requiresUncachedMocs, + partitionCount); EXPECT_FALSE(requiresUncachedMocs); GenCmdList commands; @@ -101,6 +105,7 @@ HWTEST_F(CommandEncodeStatesUncachedMocsTests, whenEncodingDispatchKernelWithUnc std::unique_ptr dispatchInterface(new MockDispatchKernelEncoder()); cmdContainer->setDirtyStateForAllHeaps(false); bool requiresUncachedMocs = true; + uint32_t partitionCount = 0; EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, @@ -109,7 +114,8 @@ HWTEST_F(CommandEncodeStatesUncachedMocsTests, whenEncodingDispatchKernelWithUnc 0, pDevice, NEO::PreemptionMode::Disabled, - requiresUncachedMocs); + requiresUncachedMocs, + partitionCount); EXPECT_FALSE(requiresUncachedMocs); GenCmdList commands; @@ -135,6 +141,7 @@ HWTEST_F(CommandEncodeStatesUncachedMocsTests, whenEncodingDispatchKernelWithNon std::unique_ptr dispatchInterface(new MockDispatchKernelEncoder()); cmdContainer->setDirtyStateForAllHeaps(true); bool requiresUncachedMocs = false; + uint32_t partitionCount = 0; EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, @@ -143,7 +150,8 @@ HWTEST_F(CommandEncodeStatesUncachedMocsTests, whenEncodingDispatchKernelWithNon 0, pDevice, NEO::PreemptionMode::Disabled, - requiresUncachedMocs); + requiresUncachedMocs, + partitionCount); EXPECT_FALSE(requiresUncachedMocs); GenCmdList commands; @@ -169,6 +177,7 @@ HWTEST_F(CommandEncodeStatesUncachedMocsTests, whenEncodingDispatchKernelWithNon std::unique_ptr dispatchInterface(new MockDispatchKernelEncoder()); cmdContainer->setDirtyStateForAllHeaps(false); bool requiresUncachedMocs = false; + uint32_t partitionCount = 0; EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, @@ -177,7 +186,8 @@ HWTEST_F(CommandEncodeStatesUncachedMocsTests, whenEncodingDispatchKernelWithNon 0, pDevice, NEO::PreemptionMode::Disabled, - requiresUncachedMocs); + requiresUncachedMocs, + partitionCount); EXPECT_FALSE(requiresUncachedMocs); GenCmdList commands; @@ -201,6 +211,7 @@ HWTEST_F(CommandEncodeStatesUncachedMocsTests, whenEncodingDispatchKernelWithNon cmdContainer->setDirtyStateForAllHeaps(false); bool requiresUncachedMocs = false; + uint32_t partitionCount = 0; EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, @@ -209,7 +220,8 @@ HWTEST_F(CommandEncodeStatesUncachedMocsTests, whenEncodingDispatchKernelWithNon 0, pDevice, NEO::PreemptionMode::Disabled, - requiresUncachedMocs); + requiresUncachedMocs, + partitionCount); EXPECT_FALSE(requiresUncachedMocs); GenCmdList commands; @@ -231,7 +243,9 @@ HWTEST_F(CommandEncodeStatesTest, givenCommandContainerWithUsedAvailableSizeWhen cmdContainer->getCommandStream()->getSpace(cmdContainer->getCommandStream()->getAvailableSpace() - sizeof(typename FamilyType::MI_BATCH_BUFFER_END)); bool requiresUncachedMocs = false; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); auto cmdBuffersCountAfter = cmdContainer->getCmdBufferAllocations().size(); @@ -246,7 +260,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenSlmTotalSizeGraterThan EXPECT_CALL(*dispatchInterface.get(), getSlmTotalSize()).WillRepeatedly(::testing::Return(slmTotalSize)); bool requiresUncachedMocs = false; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); auto interfaceDescriptorData = static_cast(cmdContainer->getIddBlock()); @@ -264,7 +280,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenSlmTotalSizeEqualZeroW EXPECT_CALL(*dispatchInterface.get(), getSlmTotalSize()).WillRepeatedly(::testing::Return(slmTotalSize)); bool requiresUncachedMocs = false; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); auto interfaceDescriptorData = static_cast(cmdContainer->getIddBlock()); @@ -297,7 +315,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenOneBindingTableEntryWh EXPECT_CALL(*dispatchInterface.get(), getSurfaceStateHeapDataSize()).WillRepeatedly(::testing::Return(static_cast(sizeof(BINDING_TABLE_STATE)))); bool requiresUncachedMocs = false; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); auto interfaceDescriptorData = static_cast(cmdContainer->getIddBlock()); EXPECT_EQ(interfaceDescriptorData->getBindingTablePointer(), expectedOffset); @@ -325,7 +345,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, giveNumBindingTableZeroWhen EXPECT_CALL(*dispatchInterface.get(), getSurfaceStateHeapDataSize()).WillRepeatedly(::testing::Return(static_cast(sizeof(BINDING_TABLE_STATE)))); bool requiresUncachedMocs = false; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); auto interfaceDescriptorData = static_cast(cmdContainer->getIddBlock()); EXPECT_EQ(interfaceDescriptorData->getBindingTablePointer(), 0u); @@ -351,7 +373,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, giveNumSamplersOneWhenDispa EXPECT_CALL(*dispatchInterface.get(), getDynamicStateHeapData()).WillRepeatedly(::testing::Return(dshData)); bool requiresUncachedMocs = false; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); auto interfaceDescriptorData = static_cast(cmdContainer->getIddBlock()); auto borderColorOffsetInDsh = usedBefore; @@ -383,7 +407,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, giveNumSamplersZeroWhenDisp EXPECT_CALL(*dispatchInterface.get(), getDynamicStateHeapData()).WillRepeatedly(::testing::Return(dshData)); bool requiresUncachedMocs = false; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); auto interfaceDescriptorData = static_cast(cmdContainer->getIddBlock()); auto borderColorOffsetInDsh = usedBefore; @@ -405,7 +431,9 @@ HWTEST_F(CommandEncodeStatesTest, givenIndirectOffsetsCountsWhenDispatchingKerne dispatchInterface->kernelDescriptor.payloadMappings.dispatchTraits.numWorkGroups[2] = offsets[2]; bool requiresUncachedMocs = false; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, true, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, true, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); GenCmdList commands; CmdParse::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); @@ -431,7 +459,9 @@ HWTEST_F(CommandEncodeStatesTest, givenIndarectOffsetsSizeWhenDispatchingKernelT dispatchInterface->kernelDescriptor.payloadMappings.dispatchTraits.globalWorkSize[2] = offsets[2]; bool requiresUncachedMocs = false; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, true, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, true, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); GenCmdList commands; CmdParse::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); @@ -469,7 +499,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchModeDe cmdContainer.reset(new MyMockCommandContainer()); cmdContainer->initialize(pDevice); bool requiresUncachedMocs = false; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); auto dsh = cmdContainer->getIndirectHeap(HeapType::DYNAMIC_STATE); @@ -499,7 +531,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchModeDe cmdContainer->initialize(pDevice); bool requiresUncachedMocs = false; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); auto dsh = cmdContainer->getIndirectHeap(HeapType::DYNAMIC_STATE); @@ -524,7 +558,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchModeDe cmdContainer->initialize(pDevice); bool requiresUncachedMocs = false; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); auto dsh = cmdContainer->getIndirectHeap(HeapType::DYNAMIC_STATE); @@ -553,7 +589,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenCleanHeapsAndSlmNotCha cmdContainer->setDirtyStateForAllHeaps(false); bool requiresUncachedMocs = false; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); GenCmdList commands; CmdParse::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); @@ -575,7 +613,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenCleanHeapsAndSlmNotCha cmdContainer->setDirtyStateForAllHeaps(false); bool requiresUncachedMocs = true; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); GenCmdList commands; CmdParse::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); @@ -600,7 +640,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenDirtyHeapsAndSlmNotCha cmdContainer->setDirtyStateForAllHeaps(true); bool requiresUncachedMocs = false; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); GenCmdList commands; CmdParse::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); @@ -621,7 +663,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenDirtyHeapsWhenDispatch cmdContainer->setDirtyStateForAllHeaps(true); bool requiresUncachedMocs = false; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); GenCmdList cmdList; CmdParse::parseCommandBuffer(cmdList, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); @@ -659,7 +703,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenCleanHeapsAndSlmChange auto slmSizeBefore = cmdContainer->slmSize; bool requiresUncachedMocs = false; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); GenCmdList commands; CmdParse::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); @@ -681,7 +727,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, giveNextIddInBlockZeorWhenD cmdContainer->nextIddInBlock = 0; bool requiresUncachedMocs = false; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); GenCmdList commands; CmdParse::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); @@ -715,7 +763,9 @@ HWTEST2_F(EncodeDispatchKernelTest, givenBindfulKernelWhenDispatchingKernelThenS auto usedBefore = cmdContainer->getIndirectHeap(HeapType::SURFACE_STATE)->getUsed(); bool requiresUncachedMocs = false; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); auto usedAfter = cmdContainer->getIndirectHeap(HeapType::SURFACE_STATE)->getUsed(); EXPECT_NE(usedAfter, usedBefore); @@ -742,7 +792,9 @@ HWTEST2_F(EncodeDispatchKernelTest, givenBindlessKernelWhenDispatchingKernelThen bool requiresUncachedMocs = false; auto usedBefore = cmdContainer->getIndirectHeap(HeapType::SURFACE_STATE)->getUsed(); - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); auto usedAfter = cmdContainer->getIndirectHeap(HeapType::SURFACE_STATE)->getUsed(); EXPECT_EQ(usedAfter, usedBefore); @@ -799,7 +851,9 @@ HWTEST_F(EncodeDispatchKernelTest, givenNonBindlessOrStatelessArgWhenDispatching EXPECT_CALL(*dispatchInterface.get(), getSurfaceStateHeapDataSize()).WillRepeatedly(::testing::Return(static_cast(sizeof(BINDING_TABLE_STATE)))); bool requiresUncachedMocs = false; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); EXPECT_EQ(pattern, *patchLocation); iOpenCL::SPatchSamplerKernelArgument samplerArg = {}; @@ -823,8 +877,8 @@ HWTEST_F(EncodeDispatchKernelTest, givenNonBindlessOrStatelessArgWhenDispatching ioh->replaceBuffer(ioh->getCpuBase(), ioh->getMaxAvailableSpace()); memset(ioh->getCpuBase(), 0, ioh->getMaxAvailableSpace()); - - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); EXPECT_THAT(ptrOffset(ioh->getCpuBase(), iohOffset), MemoryZeroed(ioh->getMaxAvailableSpace() - iohOffset)); } @@ -1051,7 +1105,9 @@ HWTEST_F(BindlessCommandEncodeStatesTesttt, givenBindlessKernelWhenBindlessModeE bool requiresUncachedMocs = false; EXPECT_EQ(commandContainer->getIndirectHeap(HeapType::SURFACE_STATE), nullptr); - EncodeDispatchKernel::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); EXPECT_EQ(commandContainer->getIndirectHeap(HeapType::SURFACE_STATE), nullptr); } @@ -1082,7 +1138,9 @@ HWTEST_F(BindlessCommandEncodeStatesTesttt, givenBindfulKernelWhenBindlessModeEn bool requiresUncachedMocs = false; EXPECT_EQ(commandContainer->getIndirectHeap(HeapType::SURFACE_STATE), nullptr); - EncodeDispatchKernel::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); EXPECT_NE(commandContainer->getIndirectHeap(HeapType::SURFACE_STATE), nullptr); } @@ -1113,12 +1171,17 @@ HWTEST_F(BindlessCommandEncodeStatesTesttt, givenBindlessModeEnabledWhenDispatch bool requiresUncachedMocs = false; EXPECT_EQ(commandContainer->getIndirectHeap(HeapType::SURFACE_STATE), nullptr); - EncodeDispatchKernel::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); auto sshBefore = commandContainer->getIndirectHeap(HeapType::SURFACE_STATE); - EncodeDispatchKernel::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); - EncodeDispatchKernel::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + EncodeDispatchKernel::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); + EncodeDispatchKernel::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); auto sshAfter = commandContainer->getIndirectHeap(HeapType::SURFACE_STATE); - EncodeDispatchKernel::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + EncodeDispatchKernel::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); EXPECT_EQ(sshBefore, sshAfter); } @@ -1145,7 +1208,9 @@ HWTEST_F(BindlessCommandEncodeStatesTest, givenGlobalBindlessHeapsWhenDispatchin EXPECT_CALL(*dispatchInterface.get(), getDynamicStateHeapData()).WillRepeatedly(::testing::Return(dshData)); bool requiresUncachedMocs = false; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); EXPECT_NE(std::find(cmdContainer->getResidencyContainer().begin(), cmdContainer->getResidencyContainer().end(), pDevice->getBindlessHeapsHelper()->getHeap(BindlessHeapsHelper::GLOBAL_DSH)->getGraphicsAllocation()), cmdContainer->getResidencyContainer().end()); } @@ -1171,6 +1236,8 @@ HWTEST_F(BindlessCommandEncodeStatesTest, givenBindlessModeDisabledelWithSampler EXPECT_CALL(*dispatchInterface.get(), getDynamicStateHeapData()).WillRepeatedly(::testing::Return(dshData)); bool requiresUncachedMocs = false; - EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs); + uint32_t partitionCount = 0; + EncodeDispatchKernel::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, pDevice, + NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount); EXPECT_EQ(std::find(cmdContainer->getResidencyContainer().begin(), cmdContainer->getResidencyContainer().end(), pDevice->getBindlessHeapsHelper()->getHeap(BindlessHeapsHelper::GLOBAL_DSH)->getGraphicsAllocation()), cmdContainer->getResidencyContainer().end()); -} \ No newline at end of file +}