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
This commit is contained in:
foreman
2019-06-11 03:43:41 -04:00
parent c68c9e9c1a
commit 695e10f698
+2 -2
View File
@@ -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;