Cleanup stream from hip:Event class.

Change-Id: I98de07d33bb7fea8f5e2d32b288c15f10ce58902
Этот коммит содержится в:
Saleel Kudchadker committed 2020-03-31 11:22:00 -07:00
1 родитель 9420f56c66
Коммит 65722f8cca
2 files changed
+7 -14

No files matched your search

+3 -13
Просмотреть файл
@@ -95,16 +95,13 @@ hipError_t Event::elapsedTime(Event& eStop, float& ms) {
}
hipError_t Event::streamWait(amd::HostQueue* hostQueue, uint flags) {
if (stream_ == hostQueue) return hipSuccess;
if ((event_ == nullptr) || (event_->command().queue() == hostQueue)) {
return hipSuccess;
}
amd::ScopedLock lock(lock_);
bool retain = false;
if (event_ == nullptr) {
event_ = stream_->getLastQueuedCommand(true);
retain = true;
}
if (!event_->notifyCmdQueue()) {
return hipErrorLaunchOutOfResources;
}
@@ -118,19 +115,12 @@ hipError_t Event::streamWait(amd::HostQueue* hostQueue, uint flags) {
command->enqueue();
command->release();
if (retain) {
event_->release();
event_ = nullptr;
}
return hipSuccess;
}
void Event::addMarker(amd::HostQueue* queue, amd::Command* command) {
amd::ScopedLock lock(lock_);
stream_ = queue;
if (event_ == &command->event()) return;
if (event_ != nullptr) {