Add a parameter to the encode function

Signed-off-by: Daria Hinz <daria.hinz@intel.com>
This commit is contained in:
Daria Hinz
2021-04-21 15:52:50 +00:00
committed by Compute-Runtime-Automation
parent c99b223aed
commit 53104e0830
4 changed files with 72 additions and 65 deletions

View File

@@ -108,6 +108,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(z
kernel, kernel,
0, 0,
false, false,
false,
neoDevice, neoDevice,
commandListPreemptionMode, commandListPreemptionMode,
this->containsStatelessUncachedResource, this->containsStatelessUncachedResource,

View File

@@ -36,6 +36,7 @@ struct EncodeDispatchKernel {
DispatchKernelEncoderI *dispatchInterface, DispatchKernelEncoderI *dispatchInterface,
uint64_t eventAddress, uint64_t eventAddress,
bool isTimestampEvent, bool isTimestampEvent,
bool L3FlushEnable,
Device *device, Device *device,
PreemptionMode preemptionMode, PreemptionMode preemptionMode,
bool &requiresUncachedMocs, bool &requiresUncachedMocs,

View File

@@ -25,7 +25,7 @@ namespace NEO {
template <typename Family> template <typename Family>
void EncodeDispatchKernel<Family>::encode(CommandContainer &container, void EncodeDispatchKernel<Family>::encode(CommandContainer &container,
const void *pThreadGroupDimensions, bool isIndirect, bool isPredicate, DispatchKernelEncoderI *dispatchInterface, const void *pThreadGroupDimensions, bool isIndirect, bool isPredicate, DispatchKernelEncoderI *dispatchInterface,
uint64_t eventAddress, bool isTimestampEvent, Device *device, PreemptionMode preemptionMode, bool &requiresUncachedMocs, uint64_t eventAddress, bool isTimestampEvent, bool L3FlushEnable, Device *device, PreemptionMode preemptionMode, bool &requiresUncachedMocs,
uint32_t &partitionCount, bool isInternal) { uint32_t &partitionCount, bool isInternal) {
using MEDIA_STATE_FLUSH = typename Family::MEDIA_STATE_FLUSH; using MEDIA_STATE_FLUSH = typename Family::MEDIA_STATE_FLUSH;

View File

@@ -49,8 +49,8 @@ HWTEST_F(CommandEncodeStatesTest, givenenDispatchInterfaceWhenDispatchKernelThen
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
GenCmdList commands; GenCmdList commands;
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
@@ -78,6 +78,7 @@ HWTEST_F(CommandEncodeStatesUncachedMocsTests, whenEncodingDispatchKernelWithUnc
dispatchInterface.get(), dispatchInterface.get(),
0, 0,
false, false,
false,
pDevice, pDevice,
NEO::PreemptionMode::Disabled, NEO::PreemptionMode::Disabled,
requiresUncachedMocs, requiresUncachedMocs,
@@ -116,6 +117,7 @@ HWTEST_F(CommandEncodeStatesUncachedMocsTests, whenEncodingDispatchKernelWithUnc
dispatchInterface.get(), dispatchInterface.get(),
0, 0,
false, false,
false,
pDevice, pDevice,
NEO::PreemptionMode::Disabled, NEO::PreemptionMode::Disabled,
requiresUncachedMocs, requiresUncachedMocs,
@@ -154,6 +156,7 @@ HWTEST_F(CommandEncodeStatesUncachedMocsTests, whenEncodingDispatchKernelWithNon
dispatchInterface.get(), dispatchInterface.get(),
0, 0,
false, false,
false,
pDevice, pDevice,
NEO::PreemptionMode::Disabled, NEO::PreemptionMode::Disabled,
requiresUncachedMocs, requiresUncachedMocs,
@@ -192,6 +195,7 @@ HWTEST_F(CommandEncodeStatesUncachedMocsTests, whenEncodingDispatchKernelWithNon
dispatchInterface.get(), dispatchInterface.get(),
0, 0,
false, false,
false,
pDevice, pDevice,
NEO::PreemptionMode::Disabled, NEO::PreemptionMode::Disabled,
requiresUncachedMocs, requiresUncachedMocs,
@@ -228,6 +232,7 @@ HWTEST_F(CommandEncodeStatesUncachedMocsTests, whenEncodingDispatchKernelWithNon
dispatchInterface.get(), dispatchInterface.get(),
0, 0,
false, false,
false,
pDevice, pDevice,
NEO::PreemptionMode::Disabled, NEO::PreemptionMode::Disabled,
requiresUncachedMocs, requiresUncachedMocs,
@@ -256,8 +261,8 @@ HWTEST_F(CommandEncodeStatesTest, givenCommandContainerWithUsedAvailableSizeWhen
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
auto cmdBuffersCountAfter = cmdContainer->getCmdBufferAllocations().size(); auto cmdBuffersCountAfter = cmdContainer->getCmdBufferAllocations().size();
@@ -274,8 +279,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenSlmTotalSizeGraterThan
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
auto interfaceDescriptorData = static_cast<INTERFACE_DESCRIPTOR_DATA *>(cmdContainer->getIddBlock()); auto interfaceDescriptorData = static_cast<INTERFACE_DESCRIPTOR_DATA *>(cmdContainer->getIddBlock());
@@ -295,8 +300,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenSlmTotalSizeEqualZeroW
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
auto interfaceDescriptorData = static_cast<INTERFACE_DESCRIPTOR_DATA *>(cmdContainer->getIddBlock()); auto interfaceDescriptorData = static_cast<INTERFACE_DESCRIPTOR_DATA *>(cmdContainer->getIddBlock());
@@ -331,8 +336,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenOneBindingTableEntryWh
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
auto interfaceDescriptorData = static_cast<INTERFACE_DESCRIPTOR_DATA *>(cmdContainer->getIddBlock()); auto interfaceDescriptorData = static_cast<INTERFACE_DESCRIPTOR_DATA *>(cmdContainer->getIddBlock());
@@ -363,8 +368,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, giveNumBindingTableZeroWhen
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
auto interfaceDescriptorData = static_cast<INTERFACE_DESCRIPTOR_DATA *>(cmdContainer->getIddBlock()); auto interfaceDescriptorData = static_cast<INTERFACE_DESCRIPTOR_DATA *>(cmdContainer->getIddBlock());
@@ -393,8 +398,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, giveNumSamplersOneWhenDispa
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
auto interfaceDescriptorData = static_cast<INTERFACE_DESCRIPTOR_DATA *>(cmdContainer->getIddBlock()); auto interfaceDescriptorData = static_cast<INTERFACE_DESCRIPTOR_DATA *>(cmdContainer->getIddBlock());
@@ -429,8 +434,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, giveNumSamplersZeroWhenDisp
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
auto interfaceDescriptorData = static_cast<INTERFACE_DESCRIPTOR_DATA *>(cmdContainer->getIddBlock()); auto interfaceDescriptorData = static_cast<INTERFACE_DESCRIPTOR_DATA *>(cmdContainer->getIddBlock());
@@ -455,8 +460,8 @@ HWTEST_F(CommandEncodeStatesTest, givenIndirectOffsetsCountsWhenDispatchingKerne
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, true, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, true, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
GenCmdList commands; GenCmdList commands;
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
@@ -484,8 +489,8 @@ HWTEST_F(CommandEncodeStatesTest, givenIndarectOffsetsSizeWhenDispatchingKernelT
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, true, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, true, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
GenCmdList commands; GenCmdList commands;
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
@@ -525,8 +530,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchModeDe
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
auto dsh = cmdContainer->getIndirectHeap(HeapType::DYNAMIC_STATE); auto dsh = cmdContainer->getIndirectHeap(HeapType::DYNAMIC_STATE);
@@ -558,8 +563,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchModeDe
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
auto dsh = cmdContainer->getIndirectHeap(HeapType::DYNAMIC_STATE); auto dsh = cmdContainer->getIndirectHeap(HeapType::DYNAMIC_STATE);
@@ -586,8 +591,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchModeDe
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
auto dsh = cmdContainer->getIndirectHeap(HeapType::DYNAMIC_STATE); auto dsh = cmdContainer->getIndirectHeap(HeapType::DYNAMIC_STATE);
@@ -618,8 +623,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenCleanHeapsAndSlmNotCha
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
GenCmdList commands; GenCmdList commands;
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
@@ -643,8 +648,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenCleanHeapsAndSlmNotCha
bool requiresUncachedMocs = true; bool requiresUncachedMocs = true;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
GenCmdList commands; GenCmdList commands;
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
@@ -671,8 +676,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenDirtyHeapsAndSlmNotCha
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
GenCmdList commands; GenCmdList commands;
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
@@ -695,8 +700,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenDirtyHeapsWhenDispatch
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
GenCmdList cmdList; GenCmdList cmdList;
CmdParse<FamilyType>::parseCommandBuffer(cmdList, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); CmdParse<FamilyType>::parseCommandBuffer(cmdList, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
@@ -736,8 +741,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenCleanHeapsAndSlmChange
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
GenCmdList commands; GenCmdList commands;
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
@@ -761,8 +766,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, giveNextIddInBlockZeorWhenD
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
GenCmdList commands; GenCmdList commands;
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed()); CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
@@ -798,8 +803,8 @@ HWTEST2_F(EncodeDispatchKernelTest, givenBindfulKernelWhenDispatchingKernelThenS
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
auto usedAfter = cmdContainer->getIndirectHeap(HeapType::SURFACE_STATE)->getUsed(); auto usedAfter = cmdContainer->getIndirectHeap(HeapType::SURFACE_STATE)->getUsed();
@@ -829,8 +834,8 @@ HWTEST2_F(EncodeDispatchKernelTest, givenBindlessKernelWhenDispatchingKernelThen
auto usedBefore = cmdContainer->getIndirectHeap(HeapType::SURFACE_STATE)->getUsed(); auto usedBefore = cmdContainer->getIndirectHeap(HeapType::SURFACE_STATE)->getUsed();
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
auto usedAfter = cmdContainer->getIndirectHeap(HeapType::SURFACE_STATE)->getUsed(); auto usedAfter = cmdContainer->getIndirectHeap(HeapType::SURFACE_STATE)->getUsed();
@@ -890,8 +895,8 @@ HWTEST_F(EncodeDispatchKernelTest, givenNonBindlessOrStatelessArgWhenDispatching
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
EXPECT_EQ(pattern, *patchLocation); EXPECT_EQ(pattern, *patchLocation);
@@ -917,8 +922,8 @@ HWTEST_F(EncodeDispatchKernelTest, givenNonBindlessOrStatelessArgWhenDispatching
ioh->replaceBuffer(ioh->getCpuBase(), ioh->getMaxAvailableSpace()); ioh->replaceBuffer(ioh->getCpuBase(), ioh->getMaxAvailableSpace());
memset(ioh->getCpuBase(), 0, ioh->getMaxAvailableSpace()); memset(ioh->getCpuBase(), 0, ioh->getMaxAvailableSpace());
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
EXPECT_THAT(ptrOffset(ioh->getCpuBase(), iohOffset), MemoryZeroed(ioh->getMaxAvailableSpace() - iohOffset)); EXPECT_THAT(ptrOffset(ioh->getCpuBase(), iohOffset), MemoryZeroed(ioh->getMaxAvailableSpace() - iohOffset));
} }
@@ -1148,8 +1153,8 @@ HWTEST_F(BindlessCommandEncodeStatesTesttt, givenBindlessKernelWhenBindlessModeE
EXPECT_EQ(commandContainer->getIndirectHeap(HeapType::SURFACE_STATE), nullptr); EXPECT_EQ(commandContainer->getIndirectHeap(HeapType::SURFACE_STATE), nullptr);
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
EXPECT_EQ(commandContainer->getIndirectHeap(HeapType::SURFACE_STATE), nullptr); EXPECT_EQ(commandContainer->getIndirectHeap(HeapType::SURFACE_STATE), nullptr);
} }
@@ -1183,8 +1188,8 @@ HWTEST_F(BindlessCommandEncodeStatesTesttt, givenBindfulKernelWhenBindlessModeEn
EXPECT_EQ(commandContainer->getIndirectHeap(HeapType::SURFACE_STATE), nullptr); EXPECT_EQ(commandContainer->getIndirectHeap(HeapType::SURFACE_STATE), nullptr);
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
EXPECT_NE(commandContainer->getIndirectHeap(HeapType::SURFACE_STATE), nullptr); EXPECT_NE(commandContainer->getIndirectHeap(HeapType::SURFACE_STATE), nullptr);
} }
@@ -1218,17 +1223,17 @@ HWTEST_F(BindlessCommandEncodeStatesTesttt, givenBindlessModeEnabledWhenDispatch
EXPECT_EQ(commandContainer->getIndirectHeap(HeapType::SURFACE_STATE), nullptr); EXPECT_EQ(commandContainer->getIndirectHeap(HeapType::SURFACE_STATE), nullptr);
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
auto sshBefore = commandContainer->getIndirectHeap(HeapType::SURFACE_STATE);
EncodeDispatchKernel<FamilyType>::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
EncodeDispatchKernel<FamilyType>::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
auto sshAfter = commandContainer->getIndirectHeap(HeapType::SURFACE_STATE);
EncodeDispatchKernel<FamilyType>::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
auto sshBefore = commandContainer->getIndirectHeap(HeapType::SURFACE_STATE);
EncodeDispatchKernel<FamilyType>::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
EncodeDispatchKernel<FamilyType>::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
auto sshAfter = commandContainer->getIndirectHeap(HeapType::SURFACE_STATE);
EncodeDispatchKernel<FamilyType>::encode(*commandContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
EXPECT_EQ(sshBefore, sshAfter); EXPECT_EQ(sshBefore, sshAfter);
} }
@@ -1257,8 +1262,8 @@ HWTEST_F(BindlessCommandEncodeStatesTest, givenGlobalBindlessHeapsWhenDispatchin
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
EXPECT_NE(std::find(cmdContainer->getResidencyContainer().begin(), cmdContainer->getResidencyContainer().end(), pDevice->getBindlessHeapsHelper()->getHeap(BindlessHeapsHelper::GLOBAL_DSH)->getGraphicsAllocation()), cmdContainer->getResidencyContainer().end()); EXPECT_NE(std::find(cmdContainer->getResidencyContainer().begin(), cmdContainer->getResidencyContainer().end(), pDevice->getBindlessHeapsHelper()->getHeap(BindlessHeapsHelper::GLOBAL_DSH)->getGraphicsAllocation()), cmdContainer->getResidencyContainer().end());
} }
@@ -1287,8 +1292,8 @@ HWTEST_F(BindlessCommandEncodeStatesTest, givenBindlessModeDisabledelWithSampler
bool requiresUncachedMocs = false; bool requiresUncachedMocs = false;
uint32_t partitionCount = 0; uint32_t partitionCount = 0;
EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, pDevice, EncodeDispatchKernel<FamilyType>::encode(*cmdContainer.get(), dims, false, false, dispatchInterface.get(), 0, false, false,
NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false); pDevice, NEO::PreemptionMode::Disabled, requiresUncachedMocs, partitionCount, false);
EXPECT_EQ(std::find(cmdContainer->getResidencyContainer().begin(), cmdContainer->getResidencyContainer().end(), pDevice->getBindlessHeapsHelper()->getHeap(BindlessHeapsHelper::GLOBAL_DSH)->getGraphicsAllocation()), cmdContainer->getResidencyContainer().end()); EXPECT_EQ(std::find(cmdContainer->getResidencyContainer().begin(), cmdContainer->getResidencyContainer().end(), pDevice->getBindlessHeapsHelper()->getHeap(BindlessHeapsHelper::GLOBAL_DSH)->getGraphicsAllocation()), cmdContainer->getResidencyContainer().end());
} }