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

Šī revīzija ir iekļauta:
Ben Sander
2017-10-31 22:26:26 +00:00
vecāks 5a80c4108e
revīzija 172b9f96e6
2 mainīti faili ar 11 papildinājumiem un 1 dzēšanām
+8
Parādīt failu
@@ -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 {
+3 -1
Parādīt failu
@@ -209,7 +209,8 @@ extern const char *API_COLOR_END;
#define DB_SYNC 1 /* 0x02 - trace synchronization pieces */
#define DB_MEM 2 /* 0x04 - trace memory allocation / deallocation */
#define DB_COPY 3 /* 0x08 - trace memory copy and peer commands. . */
#define DB_MAX_FLAG 4
#define DB_WARN 4 /* 0x10 - warn about sub-optimal or shady behavior */
#define DB_MAX_FLAG 5
// When adding a new debug flag, also add to the char name table below.
//
//
@@ -226,6 +227,7 @@ static const DbName dbName [] =
{KYEL, "sync"},
{KCYN, "mem"},
{KMAG, "copy"},
{KRED, "warn"},
};