mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
Change-Id: If965c79d70392db26597aea4c2f3b7ae2820fe96 Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
39 lines
1.3 KiB
C++
39 lines
1.3 KiB
C++
/*
|
|
* Copyright (C) 2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "runtime/helpers/csr_deps.h"
|
|
|
|
#include "runtime/command_queue/command_queue.h"
|
|
#include "runtime/event/event.h"
|
|
#include "runtime/helpers/properties_helper.h"
|
|
#include "runtime/helpers/timestamp_packet.h"
|
|
|
|
namespace NEO {
|
|
void CsrDependencies::fillFromEventsRequestAndMakeResident(const EventsRequest &eventsRequest,
|
|
CommandStreamReceiver ¤tCsr,
|
|
DependenciesType depsType) {
|
|
for (cl_uint i = 0; i < eventsRequest.numEventsInWaitList; i++) {
|
|
auto event = castToObjectOrAbort<Event>(eventsRequest.eventWaitList[i]);
|
|
if (event->isUserEvent()) {
|
|
continue;
|
|
}
|
|
|
|
auto timestampPacketContainer = event->getTimestampPacketNodes();
|
|
if (!timestampPacketContainer || timestampPacketContainer->peekNodes().empty()) {
|
|
continue;
|
|
}
|
|
|
|
timestampPacketContainer->makeResident(currentCsr);
|
|
auto sameCsr = (&event->getCommandQueue()->getCommandStreamReceiver() == ¤tCsr);
|
|
|
|
if (depsType == (sameCsr ? DependenciesType::OnCsr : DependenciesType::OutOfCsr)) {
|
|
this->push_back(timestampPacketContainer);
|
|
}
|
|
}
|
|
}
|
|
} // namespace NEO
|