From 695e10f698a5e171079eefe4bb8ce4d027b16850 Mon Sep 17 00:00:00 2001
From: foreman
Date: Tue, 11 Jun 2019 03:43:41 -0400
Subject: [PATCH] P4 to Git Change 1800795 by skeely@skeely_LC_linux on
2019/06/10 18:50:47
SWDEV-190922 - Revert CL 1785925.
CLOCK_MONOTONIC_RAW access latency is too large for high frequency use.
Note: Since clock use must be synchronized with ROCr this patch may cause apparent performance regressions when tested with the amd-master branch of ROCr until the corresponding ROCr patch passes through PSDB. There should be no conflict with the ROCr 2.5 release branch.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/os/os_posix.cpp#46 edit
---
rocclr/runtime/os/os_posix.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rocclr/runtime/os/os_posix.cpp b/rocclr/runtime/os/os_posix.cpp
index 7a9c33b269..9b7e33e317 100644
--- a/rocclr/runtime/os/os_posix.cpp
+++ b/rocclr/runtime/os/os_posix.cpp
@@ -429,7 +429,7 @@ void Os::yield() { ::sched_yield(); }
uint64_t Os::timeNanos() {
struct timespec tp;
- ::clock_gettime(CLOCK_MONOTONIC_RAW, &tp);
+ ::clock_gettime(CLOCK_MONOTONIC, &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_RAW, &tp);
+ ::clock_getres(CLOCK_MONOTONIC, &tp);
resolution = (uint64_t)tp.tv_sec * (1000ULL * 1000ULL * 1000ULL) + (uint64_t)tp.tv_nsec;
}
return resolution;