P4 to Git Change 1785925 by skeely@skeely_LC_linux on 2019/05/21 23:23:32
SWDEV-190142 - Switch os::TimeNanos to use CLOCK_MONOTONIC_RAW. Avoids NTP adjustment and re-aligns CPU clock usage with ROCm. Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/os/os_posix.cpp#45 edit
Этот коммит содержится в:
@@ -429,7 +429,7 @@ void Os::yield() { ::sched_yield(); }
|
||||
|
||||
uint64_t Os::timeNanos() {
|
||||
struct timespec tp;
|
||||
::clock_gettime(CLOCK_MONOTONIC, &tp);
|
||||
::clock_gettime(CLOCK_MONOTONIC_RAW, &tp);
|
||||
return (uint64_t)tp.tv_sec * (1000ULL * 1000ULL * 1000ULL) + (uint64_t)tp.tv_nsec;
|
||||
}
|
||||
|
||||
@@ -437,7 +437,7 @@ uint64_t Os::timerResolutionNanos() {
|
||||
static uint64_t resolution = 0;
|
||||
if (resolution == 0) {
|
||||
struct timespec tp;
|
||||
::clock_getres(CLOCK_MONOTONIC, &tp);
|
||||
::clock_getres(CLOCK_MONOTONIC_RAW, &tp);
|
||||
resolution = (uint64_t)tp.tv_sec * (1000ULL * 1000ULL * 1000ULL) + (uint64_t)tp.tv_nsec;
|
||||
}
|
||||
return resolution;
|
||||
|
||||
Ссылка в новой задаче
Block a user