mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 22:12:59 +08:00
feature: add heapless and global stateless scratch address patching
Related-To: NEO-10381 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
78885ae1fe
commit
73d558058c
@@ -100,6 +100,7 @@ struct UnitTestHelper {
|
||||
|
||||
static bool findStateCacheFlushPipeControl(LinearStream &csrStream);
|
||||
static void verifyDummyBlitWa(const RootDeviceEnvironment *rootDeviceEnvironment, GenCmdList::iterator &cmdIterator);
|
||||
static GenCmdList::iterator findWalkerCmd(GenCmdList::iterator begin, GenCmdList::iterator end, bool heapless);
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -154,4 +154,9 @@ template <typename GfxFamily>
|
||||
void UnitTestHelper<GfxFamily>::verifyDummyBlitWa(const RootDeviceEnvironment *rootDeviceEnvironment, GenCmdList::iterator &cmdIterator) {
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
GenCmdList::iterator UnitTestHelper<GfxFamily>::findWalkerCmd(GenCmdList::iterator begin, GenCmdList::iterator end, bool heapless) {
|
||||
return find<typename GfxFamily::GPGPU_WALKER *>(begin, end);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -138,4 +138,9 @@ void UnitTestHelper<GfxFamily>::verifyDummyBlitWa(const RootDeviceEnvironment *r
|
||||
}
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
GenCmdList::iterator UnitTestHelper<GfxFamily>::findWalkerCmd(GenCmdList::iterator begin, GenCmdList::iterator end, bool heapless) {
|
||||
return find<typename GfxFamily::COMPUTE_WALKER *>(begin, end);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -88,7 +88,6 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, publ
|
||||
using BaseClass::sshState;
|
||||
using BaseClass::staticWorkPartitioningEnabled;
|
||||
using BaseClass::streamProperties;
|
||||
|
||||
using BaseClass::wasSubmittedToSingleSubdevice;
|
||||
using BaseClass::CommandStreamReceiver::activePartitions;
|
||||
using BaseClass::CommandStreamReceiver::activePartitionsConfig;
|
||||
@@ -115,6 +114,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, publ
|
||||
using BaseClass::CommandStreamReceiver::globalFenceAllocation;
|
||||
using BaseClass::CommandStreamReceiver::gpuHangCheckPeriod;
|
||||
using BaseClass::CommandStreamReceiver::gsbaFor32BitProgrammed;
|
||||
using BaseClass::CommandStreamReceiver::heaplessModeEnabled;
|
||||
using BaseClass::CommandStreamReceiver::immWritePostSyncWriteOffset;
|
||||
using BaseClass::CommandStreamReceiver::initDirectSubmission;
|
||||
using BaseClass::CommandStreamReceiver::internalAllocationStorage;
|
||||
|
||||
@@ -5095,3 +5095,30 @@ HWTEST_F(CommandStreamReceiverHwHeaplessTest, whenHeaplessCommandStreamReceiverF
|
||||
EXPECT_ANY_THROW(csr->flushImmediateTaskStateless(commandStream, 0, csr->recordedImmediateDispatchFlags, *pDevice));
|
||||
EXPECT_ANY_THROW(csr->handleImmediateFlushStatelessAllocationsResidency(0, commandStream));
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
givenImmediateFlushTaskInHeaplessModeWhenNextDispatchRequiresScratchSpaceThenNoScratchIsAllocated,
|
||||
IsAtLeastXeHpCore) {
|
||||
using CFE_STATE = typename FamilyType::CFE_STATE;
|
||||
|
||||
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
commandStreamReceiver.storeMakeResidentAllocations = true;
|
||||
commandStreamReceiver.heaplessModeEnabled = true;
|
||||
|
||||
commandStreamReceiver.flushImmediateTask(commandStream, commandStream.getUsed(), immediateFlushTaskFlags, *pDevice);
|
||||
|
||||
commandStreamReceiver.setRequiredScratchSizes(0x100, 0);
|
||||
|
||||
size_t usedSize = commandStreamReceiver.commandStream.getUsed();
|
||||
commandStreamReceiver.flushImmediateTask(commandStream,
|
||||
commandStream.getUsed(),
|
||||
immediateFlushTaskFlags,
|
||||
*pDevice);
|
||||
|
||||
HardwareParse hwParserCsr;
|
||||
hwParserCsr.parseCommands<FamilyType>(commandStreamReceiver.commandStream, usedSize);
|
||||
auto frontEndCmd = hwParserCsr.getCommand<CFE_STATE>();
|
||||
ASSERT_EQ(nullptr, frontEndCmd);
|
||||
|
||||
EXPECT_EQ(nullptr, commandStreamReceiver.getScratchSpaceController()->getScratchSpaceSlot0Allocation());
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@ EncodeDispatchKernelArgs CommandEncodeStatesFixture::createDefaultDispatchKernel
|
||||
false, // dcFlushEnable
|
||||
false, // isHeaplessModeEnabled
|
||||
false, // interruptEvent
|
||||
false, // immediateScratchAddressPatching
|
||||
};
|
||||
|
||||
return args;
|
||||
|
||||
Reference in New Issue
Block a user