mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-20 13:11:34 +08:00

Change-Id: I01516616c164f19afbcd62d39a2a42d04ff768c9 Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
42 lines
1.5 KiB
C++
42 lines
1.5 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()->getGpgpuCommandStreamReceiver() == ¤tCsr);
|
|
bool pushDependency = (DependenciesType::OnCsr == depsType && sameCsr) ||
|
|
(DependenciesType::OutOfCsr == depsType && !sameCsr) ||
|
|
(DependenciesType::All == depsType);
|
|
|
|
if (pushDependency) {
|
|
this->push_back(timestampPacketContainer);
|
|
}
|
|
}
|
|
}
|
|
} // namespace NEO
|