6e2a056e1b
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