mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 17:13:29 +08:00
Extend semaphore synchronization for different command stream receivers.
Change-Id: Ic904b8c1e052adbb7b2ef82a6dec74ec69837f9f
This commit is contained in:
committed by
sys_ocldev
parent
311de0c644
commit
303014582a
@@ -201,8 +201,8 @@ class GpgpuWalkerHelper {
|
||||
IndirectHeap *ssh,
|
||||
IndirectHeap *dsh);
|
||||
|
||||
static void dispatchOnDeviceWaitlistSemaphores(LinearStream *commandStream, Device ¤tDevice,
|
||||
cl_uint numEventsInWaitList, const cl_event *eventWaitList);
|
||||
static void dispatchOnCsrWaitlistSemaphores(LinearStream *linearStream, CommandStreamReceiver ¤tCsr,
|
||||
cl_uint numEventsInWaitList, const cl_event *eventWaitList);
|
||||
|
||||
static void adjustMiStoreRegMemMode(MI_STORE_REG_MEM<GfxFamily> *storeCmd);
|
||||
};
|
||||
|
||||
@@ -362,16 +362,16 @@ void GpgpuWalkerHelper<GfxFamily>::dispatchPerfCountersCommandsEnd(
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
inline void GpgpuWalkerHelper<GfxFamily>::dispatchOnDeviceWaitlistSemaphores(LinearStream *commandStream, Device ¤tDevice,
|
||||
cl_uint numEventsInWaitList, const cl_event *eventWaitList) {
|
||||
inline void GpgpuWalkerHelper<GfxFamily>::dispatchOnCsrWaitlistSemaphores(LinearStream *linearStream, CommandStreamReceiver ¤tCsr,
|
||||
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() != ¤tDevice)) {
|
||||
if (event->isUserEvent() || (&event->getCommandQueue()->getCommandStreamReceiver() != ¤tCsr)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (auto &node : event->getTimestampPacketNodes()->peekNodes()) {
|
||||
TimestampPacketHelper::programSemaphoreWithImplicitDependency<GfxFamily>(*commandStream, *node->tag);
|
||||
TimestampPacketHelper::programSemaphoreWithImplicitDependency<GfxFamily>(*linearStream, *node->tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user