Correlate errors for time stamps which predate process start.
Small times may be given to time conversion if GPU clocks are used to accumulate elapsed time. Because HSA APIs deal in absolute time this leads to large conversion offsets of order system uptime. Variation in relative clock ratio estimation may be amplified in this case, destroying elapsed time measurements. This patch fixes the relative clock ratio used for times which predate the call to hsa_init. This correlates errors in such times allowing the elapsed time to be correctly computed. The effective maximum system uptime before elapsed time conversion becomes inaccurate is ~3.5 months. GPU event timestamps are good for process uptime of ~3.5 months. These are limited by double's mantissa precision. Change-Id: I48752ff354920439d91016d6f2b0c8ddfa60b445
Cette révision appartient à :
@@ -419,19 +419,15 @@ hsa_status_t Runtime::CopyMemory(void* dst, core::Agent& dst_agent,
|
||||
}
|
||||
|
||||
if (profiling_enabled) {
|
||||
HsaClockCounters clocks = {0};
|
||||
core::Runtime::runtime_singleton_->GetSystemInfo(
|
||||
HSA_SYSTEM_INFO_TIMESTAMP, reinterpret_cast<void*>(&clocks));
|
||||
completion_signal->signal_.start_ts = clocks.SystemClockCounter;
|
||||
core::Runtime::runtime_singleton_->GetSystemInfo(HSA_SYSTEM_INFO_TIMESTAMP,
|
||||
&completion_signal->signal_.start_ts);
|
||||
}
|
||||
|
||||
memcpy(dst, src, size);
|
||||
|
||||
if (profiling_enabled) {
|
||||
HsaClockCounters clocks = {0};
|
||||
core::Runtime::runtime_singleton_->GetSystemInfo(
|
||||
HSA_SYSTEM_INFO_TIMESTAMP, reinterpret_cast<void*>(&clocks));
|
||||
completion_signal->signal_.end_ts = clocks.SystemClockCounter;
|
||||
core::Runtime::runtime_singleton_->GetSystemInfo(HSA_SYSTEM_INFO_TIMESTAMP,
|
||||
&completion_signal->signal_.end_ts);
|
||||
}
|
||||
|
||||
completion_signal->SubRelease(1);
|
||||
@@ -513,7 +509,7 @@ hsa_status_t Runtime::GetSystemInfo(hsa_system_info_t attribute, void* value) {
|
||||
case HSA_SYSTEM_INFO_TIMESTAMP: {
|
||||
HsaClockCounters clocks;
|
||||
hsaKmtGetClockCounters(0, &clocks);
|
||||
*((uint64_t*)value) = clocks.SystemClockCounter;
|
||||
*((uint64_t*)value) = clocks.CPUClockCounter;
|
||||
break;
|
||||
}
|
||||
case HSA_SYSTEM_INFO_TIMESTAMP_FREQUENCY: {
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur