fix: set walker params prior to adjusting interface descriptor

Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
This commit is contained in:
Mrozek, Michal
2023-10-04 15:55:40 +00:00
committed by Compute-Runtime-Automation
parent ad2701ad26
commit 6f58ec9d2c
3 changed files with 36 additions and 8 deletions

View File

@@ -77,6 +77,11 @@ inline void HardwareInterface<GfxFamily>::programWalker(
auto isCcsUsed = EngineHelpers::isCcs(commandQueue.getGpgpuEngine().osContext->getEngineType());
auto kernelUsesLocalIds = HardwareCommandsHelper<GfxFamily>::kernelUsesLocalIds(kernel);
GpgpuWalkerHelper<GfxFamily>::setGpgpuWalkerThreadData(&walkerCmd, kernel.getKernelInfo().kernelDescriptor,
globalOffsets, startWorkGroups,
numWorkGroups, walkerArgs.localWorkSizes, simd, dim,
false, false, 0u);
HardwareCommandsHelper<GfxFamily>::sendIndirectState(
commandStream,
dsh,
@@ -95,11 +100,6 @@ inline void HardwareInterface<GfxFamily>::programWalker(
kernelUsesLocalIds,
commandQueue.getDevice());
GpgpuWalkerHelper<GfxFamily>::setGpgpuWalkerThreadData(&walkerCmd, kernel.getKernelInfo().kernelDescriptor,
globalOffsets, startWorkGroups,
numWorkGroups, walkerArgs.localWorkSizes, simd, dim,
false, false, 0u);
EncodeWalkerArgs encodeWalkerArgs{kernel.getExecutionType(), false, kernel.getKernelInfo().kernelDescriptor};
EncodeDispatchKernel<GfxFamily>::encodeAdditionalWalkerFields(rootDeviceEnvironment, walkerCmd, encodeWalkerArgs);
*walkerCmdBuf = walkerCmd;

View File

@@ -96,6 +96,10 @@ inline void HardwareInterface<GfxFamily>::programWalker(
EncodeMemoryPrefetch<GfxFamily>::programMemoryPrefetch(commandStream, *kernelAllocation, kernelInfo.heapInfo.kernelHeapSize, 0, rootDeviceEnvironment);
}
GpgpuWalkerHelper<GfxFamily>::setGpgpuWalkerThreadData(&walkerCmd, kernelInfo.kernelDescriptor, globalOffsets, startWorkGroups,
numWorkGroups, walkerArgs.localWorkSizes, simd, dim,
localIdsGenerationByRuntime, inlineDataProgrammingRequired, requiredWalkOrder);
HardwareCommandsHelper<GfxFamily>::sendIndirectState(
commandStream,
dsh,
@@ -114,9 +118,6 @@ inline void HardwareInterface<GfxFamily>::programWalker(
localIdsGenerationByRuntime,
commandQueue.getDevice());
GpgpuWalkerHelper<GfxFamily>::setGpgpuWalkerThreadData(&walkerCmd, kernelInfo.kernelDescriptor, globalOffsets, startWorkGroups,
numWorkGroups, walkerArgs.localWorkSizes, simd, dim,
localIdsGenerationByRuntime, inlineDataProgrammingRequired, requiredWalkOrder);
bool kernelSystemAllocation = false;
if (kernel.isBuiltIn) {
kernelSystemAllocation = kernel.getDestinationAllocationInSystemMemory();

View File

@@ -103,6 +103,33 @@ XE_HPC_CORETEST_F(MemoryPrefetchTestsXeHpcCore, givenPrefetchEnabledWhenEstimati
using ProgramWalkerTestsXeHpcCore = EnqueueFixtureXeHpcCore;
XE_HPC_CORETEST_F(ProgramWalkerTestsXeHpcCore, givenProperThreadGroupSizesWhenWalkerIsProgrammedThenThreadGroupDispatchSizeIsProperlyProgrammed) {
using COMPUTE_WALKER = typename FamilyType::COMPUTE_WALKER;
auto commandQueue = createCommandQueue<FamilyType>();
auto &commandStream = commandQueue->getCS(1024);
auto &heap = commandQueue->getIndirectHeap(IndirectHeap::Type::DYNAMIC_STATE, 1);
size_t workSize[] = {1, 1, 1};
Vec3<size_t> wgInfo = {1024, 1, 1};
HardwareInterfaceWalkerArgs walkerArgs = createHardwareInterfaceWalkerArgs(workSize, wgInfo, PreemptionMode::Disabled);
{
HardwareInterface<FamilyType>::programWalker(commandStream, *mockKernel->mockKernel, *commandQueue,
heap, heap, heap, dispatchInfo, walkerArgs);
HardwareParse hwParse;
hwParse.parseCommands<FamilyType>(commandStream, 0);
auto itorWalker = find<COMPUTE_WALKER *>(hwParse.cmdList.begin(), hwParse.cmdList.end());
EXPECT_NE(hwParse.cmdList.end(), itorWalker);
auto walkerCmd = genCmdCast<COMPUTE_WALKER *>(*itorWalker);
EXPECT_NE(nullptr, walkerCmd);
auto &idd = walkerCmd->getInterfaceDescriptor();
EXPECT_EQ(FamilyType::INTERFACE_DESCRIPTOR_DATA::THREAD_GROUP_DISPATCH_SIZE_TG_SIZE_8, idd.getThreadGroupDispatchSize());
}
}
XE_HPC_CORETEST_F(ProgramWalkerTestsXeHpcCore, givenDebugVariableSetWhenProgrammingWalkerThenSetL3Prefetch) {
using COMPUTE_WALKER = typename FamilyType::COMPUTE_WALKER;