Fix event flag detection.

Change-Id: I0b0ba66c2339021320fe3d7760fdad1a0490a76b


[ROCm/clr commit: 214673a4fb]
This commit is contained in:
Ben Sander
2016-10-15 22:12:19 -05:00
parent 1fc5bf0643
commit f6641ba37f
+2 -6
View File
@@ -36,7 +36,7 @@ hipError_t ihipEventCreate(hipEvent_t* event, unsigned flags)
// TODO-IPC - support hipEventInterprocess.
unsigned supportedFlags = hipEventDefault | hipEventBlockingSync | hipEventDisableTiming;
if ((flags & ~supportedFlags) != 0) {
if ((flags & ~supportedFlags) == 0) {
ihipEvent_t *eh = new ihipEvent_t();
eh->_state = hipEventStatusCreated;
@@ -180,11 +180,7 @@ hipError_t hipEventQuery(hipEvent_t event)
{
HIP_INIT_API(event);
// TODO-stream - need to read state of signal here: The event may have become ready after recording..
// TODO-HCC - use get_hsa_signal here.
if (event->_state == hipEventStatusRecording) {
if ((event->_state == hipEventStatusRecording) && (!event->_marker.is_ready())) {
return ihipLogStatus(hipErrorNotReady);
} else {
return ihipLogStatus(hipSuccess);