mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-01 04:23:00 +08:00
Add blocking semaphore after N enqueue.
Change-Id: I3f0a636ed67137c3bfce6345725d3b898952e4b7 Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
843edb10c8
commit
0fdaadc505
@@ -237,6 +237,13 @@ size_t EnqueueOperation<GfxFamily>::getTotalSizeRequiredCS(uint32_t eventType, c
|
||||
expectedSizeCS += TimestampPacketHelper::getRequiredCmdStreamSize<GfxFamily>(csrDeps);
|
||||
expectedSizeCS += EnqueueOperation<GfxFamily>::getSizeRequiredForTimestampPacketWrite();
|
||||
}
|
||||
|
||||
if (DebugManager.flags.AddBlockingSemaphoreAfterSpecificEnqueue.get() != -1) {
|
||||
if (DebugManager.flags.AddCacheFlushBeforeBlockingSemaphore.get()) {
|
||||
expectedSizeCS += MemorySynchronizationCommands<GfxFamily>::getSizeForSinglePipeControl();
|
||||
}
|
||||
expectedSizeCS += sizeof(typename GfxFamily::MI_SEMAPHORE_WAIT);
|
||||
}
|
||||
return expectedSizeCS;
|
||||
}
|
||||
|
||||
|
||||
@@ -102,6 +102,22 @@ void HardwareInterface<GfxFamily>::dispatchWalker(
|
||||
HardwareCommandsHelper<GfxFamily>::programCacheFlushAfterWalkerCommand(commandStream, commandQueue, mainKernel, postSyncAddress);
|
||||
}
|
||||
dispatchProfilingPerfEndCommands(hwTimeStamps, hwPerfCounter, commandStream, commandQueue);
|
||||
|
||||
if (DebugManager.flags.AddBlockingSemaphoreAfterSpecificEnqueue.get() != -1) {
|
||||
auto &gpgpuCsr = commandQueue.getGpgpuCommandStreamReceiver();
|
||||
|
||||
if (static_cast<uint32_t>(DebugManager.flags.AddBlockingSemaphoreAfterSpecificEnqueue.get()) == gpgpuCsr.peekTaskCount()) {
|
||||
if (DebugManager.flags.AddCacheFlushBeforeBlockingSemaphore.get()) {
|
||||
MemorySynchronizationCommands<GfxFamily>::addPipeControl(*commandStream, true);
|
||||
}
|
||||
|
||||
auto tagValue = *(gpgpuCsr.getTagAddress());
|
||||
auto tagAddress = gpgpuCsr.getTagAllocation()->getGpuAddress();
|
||||
|
||||
// Wait for (tag == tag - 1). This will be never satisfied.
|
||||
HardwareCommandsHelper<GfxFamily>::programMiSemaphoreWait(*commandStream, tagAddress, (tagValue - 1), GfxFamily::MI_SEMAPHORE_WAIT::COMPARE_OPERATION::COMPARE_OPERATION_SAD_EQUAL_SDD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
||||
Reference in New Issue
Block a user