mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
refactor: dedicated prefetch cmd list method
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
2174389c4e
commit
17a15a3d9d
@@ -419,6 +419,8 @@ struct CommandListCoreFamily : public CommandListImp {
|
||||
virtual void addKernelIndirectDataMemoryPrefetchPadding(NEO::LinearStream &cmdStream, const Kernel &kernel, uint64_t cmdId) {}
|
||||
virtual uint64_t getPrefetchCmdId() const { return std::numeric_limits<uint64_t>::max(); }
|
||||
virtual uint32_t getIohSizeForPrefetch(const Kernel &kernel, uint32_t reserveExtraSpace) const;
|
||||
virtual void ensureCmdBufferSpaceForPrefetch() {}
|
||||
bool kernelMemoryPrefetchEnabled() const { return NEO::debugManager.flags.EnableMemoryPrefetch.get() == 1; }
|
||||
|
||||
NEO::InOrderPatchCommandsContainer<GfxFamily> inOrderPatchCmds;
|
||||
|
||||
|
||||
@@ -396,7 +396,7 @@ void CommandListCoreFamily<gfxCoreFamily>::programL3(bool isSLMused) {}
|
||||
|
||||
template <GFXCORE_FAMILY gfxCoreFamily>
|
||||
void CommandListCoreFamily<gfxCoreFamily>::prefetchKernelMemory(NEO::LinearStream &cmdStream, const Kernel &kernel, const NEO::GraphicsAllocation &ioh, size_t iohOffset, CommandToPatchContainer *outListCommands, uint64_t cmdId) {
|
||||
if (NEO::debugManager.flags.EnableMemoryPrefetch.get() != 1) {
|
||||
if (!kernelMemoryPrefetchEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -447,6 +447,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernel(ze_kernel_h
|
||||
auto kernel = Kernel::fromHandle(kernelHandle);
|
||||
auto ioh = commandContainer.getHeapWithRequiredSizeAndAlignment(NEO::IndirectHeapType::indirectObject, getIohSizeForPrefetch(*kernel, launchParams.reserveExtraPayloadSpace), GfxFamily::indirectDataAlignment);
|
||||
|
||||
ensureCmdBufferSpaceForPrefetch();
|
||||
prefetchKernelMemory(*commandContainer.getCommandStream(), *kernel, *ioh->getGraphicsAllocation(), ioh->getUsed(), launchParams.outListCommands, getPrefetchCmdId());
|
||||
|
||||
ze_result_t ret = addEventsToCmdList(numWaitEvents, phWaitEvents, launchParams.outListCommands, launchParams.relaxedOrderingDispatch, true, true, launchParams.omitAddingWaitEventsResidency, false);
|
||||
|
||||
Reference in New Issue
Block a user