mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 17:41:26 +08:00
Use Semaphore to wait for dependencies on the same device
Change-Id: Ib04c960c50183c080d02753815ece80b58d1980e Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
393ce116e7
commit
d04614dce3
@@ -494,6 +494,11 @@ void GpgpuWalkerHelper<GfxFamily>::dispatchWalker(
|
||||
ssh = &getIndirectHeap<GfxFamily, IndirectHeap::SURFACE_STATE>(commandQueue, multiDispatchInfo);
|
||||
}
|
||||
|
||||
if (commandQueue.getDevice().peekCommandStreamReceiver()->peekTimestampPacketWriteEnabled()) {
|
||||
GpgpuWalkerHelper<GfxFamily>::dispatchOnDeviceWaitlistSemaphores(commandStream, commandQueue.getDevice(),
|
||||
numEventsInWaitList, eventWaitList);
|
||||
}
|
||||
|
||||
dsh->align(KernelCommandsHelper<GfxFamily>::alignInterfaceDescriptorData);
|
||||
|
||||
uint32_t interfaceDescriptorIndex = 0;
|
||||
@@ -645,6 +650,28 @@ void GpgpuWalkerHelper<GfxFamily>::dispatchWalker(
|
||||
dispatchProfilingPerfEndCommands(hwTimeStamps, hwPerfCounter, commandStream, commandQueue);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
inline void GpgpuWalkerHelper<GfxFamily>::dispatchOnDeviceWaitlistSemaphores(LinearStream *commandStream, Device ¤tDevice,
|
||||
cl_uint numEventsInWaitList, const cl_event *eventWaitList) {
|
||||
using MI_SEMAPHORE_WAIT = typename GfxFamily::MI_SEMAPHORE_WAIT;
|
||||
|
||||
for (cl_uint i = 0; i < numEventsInWaitList; i++) {
|
||||
auto event = castToObjectOrAbort<Event>(eventWaitList[i]);
|
||||
if (event->isUserEvent() || (&event->getCommandQueue()->getDevice() != ¤tDevice)) {
|
||||
continue;
|
||||
}
|
||||
auto timestampPacket = event->getTimestampPacket();
|
||||
|
||||
auto compareAddress = timestampPacket->pickAddressForDataWrite(TimestampPacket::DataIndex::ContextEnd);
|
||||
|
||||
auto miSemaphoreCmd = commandStream->getSpaceForCmd<MI_SEMAPHORE_WAIT>();
|
||||
*miSemaphoreCmd = MI_SEMAPHORE_WAIT::sInit();
|
||||
miSemaphoreCmd->setCompareOperation(MI_SEMAPHORE_WAIT::COMPARE_OPERATION::COMPARE_OPERATION_SAD_NOT_EQUAL_SDD);
|
||||
miSemaphoreCmd->setSemaphoreDataDword(1);
|
||||
miSemaphoreCmd->setSemaphoreGraphicsAddress(compareAddress);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
inline void GpgpuWalkerHelper<GfxFamily>::getDefaultDshSpace(
|
||||
const size_t &offsetInterfaceDescriptorTable,
|
||||
|
||||
Reference in New Issue
Block a user