mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Setup enqueue dependencies in blocked path
Change-Id: Ia6d549924e3e557bae74dbdac691987450cbd3b7 Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
b31e25dbb6
commit
2d5169cf65
@@ -109,4 +109,27 @@ BlitterConstants::BlitDirection BlitProperties::obtainBlitDirection(uint32_t com
|
||||
: BlitterConstants::BlitDirection::BufferToHostPtr;
|
||||
}
|
||||
|
||||
void BlitProperties::setupDependenciesForAuxTranslation(BlitPropertiesContainer &blitPropertiesContainer, TimestampPacketDependencies ×tampPacketDependencies,
|
||||
TimestampPacketContainer &kernelTimestamps, const EventsRequest &eventsRequest,
|
||||
CommandStreamReceiver &gpguCsr, CommandStreamReceiver &bcsCsr) {
|
||||
auto numObjects = blitPropertiesContainer.size() / 2;
|
||||
|
||||
for (size_t i = 0; i < numObjects; i++) {
|
||||
blitPropertiesContainer[i].outputTimestampPacket = timestampPacketDependencies.auxToNonAuxNodes.peekNodes()[i];
|
||||
blitPropertiesContainer[i + numObjects].outputTimestampPacket = timestampPacketDependencies.nonAuxToAuxNodes.peekNodes()[i];
|
||||
}
|
||||
|
||||
gpguCsr.requestStallingPipeControlOnNextFlush();
|
||||
auto nodesAllocator = gpguCsr.getTimestampPacketAllocator();
|
||||
timestampPacketDependencies.barrierNodes.add(nodesAllocator->getTag());
|
||||
|
||||
// wait for barrier and events before AuxToNonAux
|
||||
blitPropertiesContainer[0].csrDependencies.push_back(×tampPacketDependencies.barrierNodes);
|
||||
blitPropertiesContainer[0].csrDependencies.fillFromEventsRequest(eventsRequest, bcsCsr,
|
||||
CsrDependencies::DependenciesType::All);
|
||||
|
||||
// wait for NDR before NonAuxToAux
|
||||
blitPropertiesContainer[numObjects].csrDependencies.push_back(&kernelTimestamps);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -24,6 +24,10 @@ struct TimestampPacketStorage;
|
||||
template <typename TagType>
|
||||
struct TagNode;
|
||||
|
||||
struct BlitProperties;
|
||||
struct TimestampPacketDependencies;
|
||||
using BlitPropertiesContainer = StackVec<BlitProperties, 32>;
|
||||
|
||||
struct BlitProperties {
|
||||
static BlitProperties constructPropertiesForReadWriteBuffer(BlitterConstants::BlitDirection blitDirection,
|
||||
CommandStreamReceiver &commandStreamReceiver,
|
||||
@@ -42,6 +46,10 @@ struct BlitProperties {
|
||||
static BlitProperties constructPropertiesForAuxTranslation(AuxTranslationDirection auxTranslationDirection,
|
||||
GraphicsAllocation *allocation);
|
||||
|
||||
static void setupDependenciesForAuxTranslation(BlitPropertiesContainer &blitPropertiesContainer, TimestampPacketDependencies ×tampPacketDependencies,
|
||||
TimestampPacketContainer &kernelTimestamps, const EventsRequest &eventsRequest,
|
||||
CommandStreamReceiver &gpguCsr, CommandStreamReceiver &bcsCsr);
|
||||
|
||||
static BlitterConstants::BlitDirection obtainBlitDirection(uint32_t commandType);
|
||||
|
||||
TagNode<TimestampPacketStorage> *outputTimestampPacket = nullptr;
|
||||
@@ -56,8 +64,6 @@ struct BlitProperties {
|
||||
uint64_t copySize = 0;
|
||||
};
|
||||
|
||||
using BlitPropertiesContainer = StackVec<BlitProperties, 32>;
|
||||
|
||||
template <typename GfxFamily>
|
||||
struct BlitCommandsHelper {
|
||||
static size_t estimateBlitCommandsSize(uint64_t copySize, const CsrDependencies &csrDependencies, bool updateTimestampPacket);
|
||||
|
||||
@@ -188,6 +188,16 @@ CompletionStamp &CommandComputeKernel::submit(uint32_t taskLevel, bool terminate
|
||||
this->kernel->getProgram()->getBlockKernelManager()->makeInternalAllocationsResident(commandStreamReceiver);
|
||||
}
|
||||
|
||||
if (kernelOperation->blitPropertiesContainer.size() > 0) {
|
||||
auto &bcsCsr = *commandQueue.getBcsCommandStreamReceiver();
|
||||
BlitProperties::setupDependenciesForAuxTranslation(kernelOperation->blitPropertiesContainer, *timestampPacketDependencies,
|
||||
*currentTimestampPacketNodes, eventsRequest,
|
||||
commandQueue.getGpgpuCommandStreamReceiver(), bcsCsr);
|
||||
|
||||
auto bcsTaskCount = bcsCsr.blitBuffer(kernelOperation->blitPropertiesContainer, false);
|
||||
commandQueue.updateBcsTaskCount(bcsTaskCount);
|
||||
}
|
||||
|
||||
DispatchFlags dispatchFlags(
|
||||
{}, //csrDependencies
|
||||
nullptr, //barrierTimestampPacketNodes
|
||||
@@ -211,8 +221,9 @@ CompletionStamp &CommandComputeKernel::submit(uint32_t taskLevel, bool terminate
|
||||
false //epilogueRequired
|
||||
);
|
||||
|
||||
if (commandStreamReceiver.peekTimestampPacketWriteEnabled()) {
|
||||
if (timestampPacketDependencies) {
|
||||
dispatchFlags.csrDependencies.fillFromEventsRequest(eventsRequest, commandStreamReceiver, CsrDependencies::DependenciesType::OutOfCsr);
|
||||
dispatchFlags.barrierTimestampPacketNodes = ×tampPacketDependencies->barrierNodes;
|
||||
}
|
||||
dispatchFlags.pipelineSelectArgs.specialPipelineSelectMode = kernel->requiresSpecialPipelineSelectMode();
|
||||
if (anyUncacheableArgs) {
|
||||
|
||||
Reference in New Issue
Block a user