Set event state AFTER it is recorded.

Цей коміт міститься в:
Ben Sander
2017-11-05 10:32:24 -06:00
джерело afd3a6786d
коміт 1c65bb1684
2 змінених файлів з 3 додано та 4 видалено
+2 -3
Переглянути файл
@@ -45,10 +45,10 @@ ihipEvent_t::ihipEvent_t(unsigned flags)
void ihipEvent_t::attachToCompletionFuture(const hc::completion_future *cf, void ihipEvent_t::attachToCompletionFuture(const hc::completion_future *cf,
hipStream_t stream, ihipEventType_t eventType) hipStream_t stream, ihipEventType_t eventType)
{ {
_state = hipEventStatusRecording;
_marker = *cf; _marker = *cf;
_type = eventType; _type = eventType;
_stream = stream; _stream = stream;
_state = hipEventStatusRecording;
} }
@@ -157,13 +157,12 @@ hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream)
event->_state = hipEventStatusComplete; event->_state = hipEventStatusComplete;
return ihipLogStatus(hipSuccess); return ihipLogStatus(hipSuccess);
} else { } else {
event->_state = hipEventStatusRecording;
// Clear timestamps // Clear timestamps
event->_timestamp = 0; event->_timestamp = 0;
// Record the event in the stream: // Record the event in the stream:
stream->locked_recordEvent(event); stream->locked_recordEvent(event);
event->_state = hipEventStatusRecording;
return ihipLogStatus(hipSuccess); return ihipLogStatus(hipSuccess);
} }
} else { } else {
+1 -1
Переглянути файл
@@ -103,7 +103,7 @@ hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int
event->locked_waitComplete((event->_flags & hipEventBlockingSync) ? hc::hcWaitModeBlocked : hc::hcWaitModeActive); event->locked_waitComplete((event->_flags & hipEventBlockingSync) ? hc::hcWaitModeBlocked : hc::hcWaitModeActive);
} else { } else {
stream = ihipSyncAndResolveStream(stream); stream = ihipSyncAndResolveStream(stream);
// This will user create_blocking_marker to wait on the specified queue. // This will use create_blocking_marker to wait on the specified queue.
stream->locked_streamWaitEvent(event); stream->locked_streamWaitEvent(event);
} }