Add HIP_DB=warn + message if sync on dangerous event.

[ROCm/clr commit: 172b9f96e6]
This commit is contained in:
Ben Sander
2017-10-31 22:26:26 +00:00
parent 19935275ea
commit 6e82cc25df
2 changed files with 11 additions and 1 deletions
+8
View File
@@ -191,6 +191,10 @@ hipError_t hipEventSynchronize(hipEvent_t event)
{
HIP_INIT_SPECIAL_API(TRACE_SYNC, event);
if (!(event->_flags & hipEventReleaseToSystem)) {
tprintf(DB_WARN, "hipEventSynchronize on event without system-scope fence ; consider creating with hipEventReleaseToSystem\n");
}
if (event) {
if (event->_state == hipEventStatusUnitialized) {
return ihipLogStatus(hipErrorInvalidResourceHandle);
@@ -268,6 +272,10 @@ hipError_t hipEventQuery(hipEvent_t event)
{
HIP_INIT_SPECIAL_API(TRACE_QUERY, event);
if (!(event->_flags & hipEventReleaseToSystem)) {
tprintf(DB_WARN, "hipEventQuery on event without system-scope fence ; consider creating with hipEventReleaseToSystem\n");
}
if ((event->_state == hipEventStatusRecording) && !event->locked_isReady()) {
return ihipLogStatus(hipErrorNotReady);
} else {