refactor: change order of fields of EncodeDispatchKernelArgs structure

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2023-10-03 18:42:36 +00:00
committed by Compute-Runtime-Automation
parent fc508212de
commit ec9fa23b2e
8 changed files with 58 additions and 51 deletions

View File

@@ -191,6 +191,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
updateStreamProperties(*kernel, launchParams.isCooperative, threadGroupDimensions, launchParams.isIndirect);
NEO::EncodeDispatchKernelArgs dispatchKernelArgs{
0, // eventAddress
static_cast<uint64_t>(Event::STATE_SIGNALED), // postSyncImmValue
neoDevice, // device
kernel, // dispatchInterface
ssh, // surfaceStateHeap
@@ -200,7 +201,6 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
&additionalCommands, // additionalCommands
commandListPreemptionMode, // preemptionMode
0, // partitionCount
static_cast<uint64_t>(Event::STATE_SIGNALED), // postSyncImmValue
launchParams.isIndirect, // isIndirect
launchParams.isPredicate, // isPredicate
false, // isTimestampEvent

View File

@@ -272,6 +272,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
NEO::EncodeDispatchKernelArgs dispatchKernelArgs{
eventAddress, // eventAddress
static_cast<uint64_t>(Event::STATE_SIGNALED), // postSyncImmValue
neoDevice, // device
kernel, // dispatchInterface
ssh, // surfaceStateHeap
@@ -281,7 +282,6 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
&additionalCommands, // additionalCommands
kernelPreemptionMode, // preemptionMode
this->partitionCount, // partitionCount
static_cast<uint64_t>(Event::STATE_SIGNALED), // postSyncImmValue
launchParams.isIndirect, // isIndirect
launchParams.isPredicate, // isPredicate
isTimestampEvent, // isTimestampEvent

View File

@@ -181,26 +181,30 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenNotEnoughSpaceInCommandStreamWhenA
const uint32_t threadGroupDimensions[3] = {1, 1, 1};
NEO::EncodeDispatchKernelArgs dispatchKernelArgs{
0,
device->getNEODevice(),
kernel.get(),
nullptr,
nullptr,
threadGroupDimensions,
nullptr,
nullptr,
PreemptionMode::MidBatch,
0,
0,
false,
false,
false,
false,
false,
false,
false,
false,
commandList->getDcFlushRequired(true)};
0, // eventAddress
0, // postSyncImmValue
device->getNEODevice(), // device
kernel.get(), // dispatchInterface
nullptr, // surfaceStateHeap
nullptr, // dynamicStateHeap
threadGroupDimensions, // threadGroupDimensions
nullptr, // outWalkerPtr
nullptr, // additionalCommands
PreemptionMode::MidBatch, // preemptionMode
0, // partitionCount
false, // isIndirect
false, // isPredicate
false, // isTimestampEvent
false, // requiresUncachedMocs
false, // useGlobalAtomics
false, // isInternal
false, // isCooperative
false, // isHostScopeSignalEvent
false, // isKernelUsingSystemAllocation
false, // isKernelDispatchedFromImmediateCmdList
false, // isRcs
commandList->getDcFlushRequired(true) // dcFlushEnable
};
NEO::EncodeDispatchKernel<FamilyType>::encode(commandContainer, dispatchKernelArgs);
auto usedSpaceAfter = commandContainer.getCommandStream()->getUsed();

View File

@@ -626,27 +626,30 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenNotEnoughSpaceInCommandStreamWhenA
const uint32_t threadGroupDimensions[3] = {1, 1, 1};
NEO::EncodeDispatchKernelArgs dispatchKernelArgs{
0,
device->getNEODevice(),
kernel.get(),
nullptr,
nullptr,
threadGroupDimensions,
nullptr,
nullptr,
PreemptionMode::MidBatch,
0,
0,
false,
false,
false,
false,
false,
false,
false,
false,
false,
commandList->getDcFlushRequired(true)};
0, // eventAddress
0, // postSyncImmValue
device->getNEODevice(), // device
kernel.get(), // dispatchInterface
nullptr, // surfaceStateHeap
nullptr, // dynamicStateHeap
threadGroupDimensions, // threadGroupDimensions
nullptr, // outWalkerPtr
nullptr, // additionalCommands
PreemptionMode::MidBatch, // preemptionMode
0, // partitionCount
false, // isIndirect
false, // isPredicate
false, // isTimestampEvent
false, // requiresUncachedMocs
false, // useGlobalAtomics
false, // isInternal
false, // isCooperative
false, // isHostScopeSignalEvent
false, // isKernelUsingSystemAllocation
false, // isKernelDispatchedFromImmediateCmdList
false, // isRcs
commandList->getDcFlushRequired(true) // dcFlushEnable
};
EXPECT_THROW(NEO::EncodeDispatchKernel<FamilyType>::encode(commandContainer, dispatchKernelArgs), std::exception);
}

View File

@@ -43,6 +43,7 @@ struct StateComputeModeProperties;
struct EncodeDispatchKernelArgs {
uint64_t eventAddress = 0ull;
uint64_t postSyncImmValue = 0;
Device *device = nullptr;
DispatchKernelEncoderI *dispatchInterface = nullptr;
IndirectHeap *surfaceStateHeap = nullptr;
@@ -52,7 +53,6 @@ struct EncodeDispatchKernelArgs {
std::list<void *> *additionalCommands = nullptr;
PreemptionMode preemptionMode = PreemptionMode::Initial;
uint32_t partitionCount = 0u;
uint64_t postSyncImmValue = 0;
bool isIndirect = false;
bool isPredicate = false;
bool isTimestampEvent = false;

View File

@@ -287,13 +287,13 @@ void EncodeDispatchKernel<Family>::encode(CommandContainer &container, EncodeDis
PreemptionHelper::applyPreemptionWaCmdsBegin<Family>(listCmdBufferStream, *args.device);
auto buffer = listCmdBufferStream->getSpace(sizeof(cmd));
*(decltype(cmd) *)buffer = cmd;
auto buffer = listCmdBufferStream->getSpaceForCmd<WALKER_TYPE>();
*buffer = cmd;
PreemptionHelper::applyPreemptionWaCmdsEnd<Family>(listCmdBufferStream, *args.device);
{
auto mediaStateFlush = listCmdBufferStream->getSpace(sizeof(MEDIA_STATE_FLUSH));
*reinterpret_cast<MEDIA_STATE_FLUSH *>(mediaStateFlush) = Family::cmdInitMediaStateFlush;
auto mediaStateFlush = listCmdBufferStream->getSpaceForCmd<MEDIA_STATE_FLUSH>();
*mediaStateFlush = Family::cmdInitMediaStateFlush;
}
args.partitionCount = 1;

View File

@@ -360,9 +360,9 @@ void EncodeDispatchKernel<Family>::encode(CommandContainer &container, EncodeDis
hwInfo);
} else {
args.partitionCount = 1;
auto buffer = listCmdBufferStream->getSpace(sizeof(walkerCmd));
auto buffer = listCmdBufferStream->getSpaceForCmd<WALKER_TYPE>();
args.outWalkerPtr = buffer;
*(decltype(walkerCmd) *)buffer = walkerCmd;
*buffer = walkerCmd;
}
PreemptionHelper::applyPreemptionWaCmdsEnd<Family>(listCmdBufferStream, *args.device);

View File

@@ -38,6 +38,7 @@ EncodeDispatchKernelArgs CommandEncodeStatesFixture::createDefaultDispatchKernel
EncodeDispatchKernelArgs args{
0, // eventAddress
0, // postSyncImmValue
device, // device
dispatchInterface, // dispatchInterface
nullptr, // surfaceStateHeap
@@ -47,7 +48,6 @@ EncodeDispatchKernelArgs CommandEncodeStatesFixture::createDefaultDispatchKernel
nullptr, // additionalCommands
PreemptionMode::Disabled, // preemptionMode
1, // partitionCount
0, // postSyncImmValue
false, // isIndirect
false, // isPredicate
false, // isTimestampEvent