Feature(OCL) Use tag nodes for root device synchronization

With this commit events created on multi root device contexts will
synchronize using signaled TagNodes instead of using taskCounts.

Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>

Related-To: NEO-7105
This commit is contained in:
Maciej Plewka
2022-12-07 11:07:43 +00:00
committed by Compute-Runtime-Automation
parent 6fac234655
commit 547d1c37b3
62 changed files with 995 additions and 210 deletions

View File

@@ -129,6 +129,9 @@ Event::~Event() {
if (timeStampNode != nullptr) {
timeStampNode->returnTag();
}
if (multiRootTimeStampSyncNode != nullptr) {
multiRootTimeStampSyncNode->returnTag();
}
if (perfCounterNode != nullptr) {
cmdQueue->getPerfCounters()->deleteQuery(perfCounterNode->getQueryHandleRef());
perfCounterNode->getQueryHandleRef() = {};
@@ -875,7 +878,6 @@ TagNodeBase *Event::getHwTimeStampNode() {
}
TagNodeBase *Event::getHwPerfCounterNode() {
if (!perfCounterNode && cmdQueue->getPerfCounters()) {
const uint32_t gpuReportSize = HwPerfCounter::getSize(*(cmdQueue->getPerfCounters()));
perfCounterNode = cmdQueue->getGpgpuCommandStreamReceiver().getEventPerfCountAllocator(gpuReportSize)->getTag();
@@ -883,11 +885,27 @@ TagNodeBase *Event::getHwPerfCounterNode() {
return perfCounterNode;
}
TagNodeBase *Event::getMultiRootTimestampSyncNode() {
auto lock = getContext()->obtainOwnershipForMultiRootDeviceAllocator();
if (getContext()->getMultiRootDeviceTimestampPacketAllocator() == nullptr) {
auto allocator = cmdQueue->getGpgpuCommandStreamReceiver().createMultiRootDeviceTimestampPacketAllocator(getContext()->getRootDeviceIndices());
getContext()->setMultiRootDeviceTimestampPacketAllocator(allocator);
}
lock.unlock();
if (multiRootDeviceTimestampPacketContainer.get() == nullptr) {
multiRootDeviceTimestampPacketContainer = std::make_unique<TimestampPacketContainer>();
}
multiRootTimeStampSyncNode = getContext()->getMultiRootDeviceTimestampPacketAllocator()->getTag();
multiRootDeviceTimestampPacketContainer->add(multiRootTimeStampSyncNode);
return multiRootTimeStampSyncNode;
}
void Event::addTimestampPacketNodes(const TimestampPacketContainer &inputTimestampPacketContainer) {
timestampPacketContainer->assignAndIncrementNodesRefCounts(inputTimestampPacketContainer);
}
TimestampPacketContainer *Event::getTimestampPacketNodes() const { return timestampPacketContainer.get(); }
TimestampPacketContainer *Event::getMultiRootDeviceTimestampPacketNodes() const { return multiRootDeviceTimestampPacketContainer.get(); }
bool Event::checkUserEventDependencies(cl_uint numEventsInWaitList, const cl_event *eventWaitList) {
bool userEventsDependencies = false;