Extend semaphore synchronization for different command stream receivers.

Change-Id: Ic904b8c1e052adbb7b2ef82a6dec74ec69837f9f
This commit is contained in:
Venevtsev, Igor
2019-01-25 10:20:32 +01:00
committed by sys_ocldev
parent 311de0c644
commit 303014582a
7 changed files with 234 additions and 15 deletions

View File

@@ -201,8 +201,8 @@ class GpgpuWalkerHelper {
IndirectHeap *ssh,
IndirectHeap *dsh);
static void dispatchOnDeviceWaitlistSemaphores(LinearStream *commandStream, Device &currentDevice,
cl_uint numEventsInWaitList, const cl_event *eventWaitList);
static void dispatchOnCsrWaitlistSemaphores(LinearStream *linearStream, CommandStreamReceiver &currentCsr,
cl_uint numEventsInWaitList, const cl_event *eventWaitList);
static void adjustMiStoreRegMemMode(MI_STORE_REG_MEM<GfxFamily> *storeCmd);
};

View File

@@ -362,16 +362,16 @@ void GpgpuWalkerHelper<GfxFamily>::dispatchPerfCountersCommandsEnd(
}
template <typename GfxFamily>
inline void GpgpuWalkerHelper<GfxFamily>::dispatchOnDeviceWaitlistSemaphores(LinearStream *commandStream, Device &currentDevice,
cl_uint numEventsInWaitList, const cl_event *eventWaitList) {
inline void GpgpuWalkerHelper<GfxFamily>::dispatchOnCsrWaitlistSemaphores(LinearStream *linearStream, CommandStreamReceiver &currentCsr,
cl_uint numEventsInWaitList, const cl_event *eventWaitList) {
for (cl_uint i = 0; i < numEventsInWaitList; i++) {
auto event = castToObjectOrAbort<Event>(eventWaitList[i]);
if (event->isUserEvent() || (&event->getCommandQueue()->getDevice() != &currentDevice)) {
if (event->isUserEvent() || (&event->getCommandQueue()->getCommandStreamReceiver() != &currentCsr)) {
continue;
}
for (auto &node : event->getTimestampPacketNodes()->peekNodes()) {
TimestampPacketHelper::programSemaphoreWithImplicitDependency<GfxFamily>(*commandStream, *node->tag);
TimestampPacketHelper::programSemaphoreWithImplicitDependency<GfxFamily>(*linearStream, *node->tag);
}
}
}

View File

@@ -91,8 +91,8 @@ void HardwareInterface<GfxFamily>::dispatchWalker(
}
if (commandQueue.getCommandStreamReceiver().peekTimestampPacketWriteEnabled()) {
GpgpuWalkerHelper<GfxFamily>::dispatchOnDeviceWaitlistSemaphores(commandStream, commandQueue.getDevice(),
numEventsInWaitList, eventWaitList);
GpgpuWalkerHelper<GfxFamily>::dispatchOnCsrWaitlistSemaphores(commandStream, commandQueue.getCommandStreamReceiver(),
numEventsInWaitList, eventWaitList);
if (previousTimestampPacketNodes) {
for (auto &node : previousTimestampPacketNodes->peekNodes()) {
TimestampPacketHelper::programSemaphoreWithImplicitDependency<GfxFamily>(*commandStream, *node->tag);