Set event state AFTER it is recorded.

This commit is contained in:
Ben Sander
2017-11-05 10:32:24 -06:00
parent afd3a6786d
commit 1c65bb1684
2 changed files with 3 additions and 4 deletions
+2 -3
View File
@@ -45,10 +45,10 @@ ihipEvent_t::ihipEvent_t(unsigned flags)
void ihipEvent_t::attachToCompletionFuture(const hc::completion_future *cf,
hipStream_t stream, ihipEventType_t eventType)
{
_state = hipEventStatusRecording;
_marker = *cf;
_type = eventType;
_stream = stream;
_state = hipEventStatusRecording;
}
@@ -157,13 +157,12 @@ hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream)
event->_state = hipEventStatusComplete;
return ihipLogStatus(hipSuccess);
} else {
event->_state = hipEventStatusRecording;
// Clear timestamps
event->_timestamp = 0;
// Record the event in the stream:
stream->locked_recordEvent(event);
event->_state = hipEventStatusRecording;
return ihipLogStatus(hipSuccess);
}
} else {