diff --git a/openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h b/openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h index ec72800cd69d..497cd06ac28e 100644 --- a/openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h +++ b/openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h @@ -105,10 +105,10 @@ INLINE uint32_t __kmpc_impl_smid() { return __smid(); } -INLINE double __target_impl_get_wtick() { return ((double)1E-9); } +INLINE double __kmpc_impl_get_wtick() { return ((double)1E-9); } EXTERN uint64_t __clock64(); -INLINE double __target_impl_get_wtime() { +INLINE double __kmpc_impl_get_wtime() { return ((double)1.0 / 745000000.0) * __clock64(); } diff --git a/openmp/libomptarget/deviceRTLs/common/src/libcall.cu b/openmp/libomptarget/deviceRTLs/common/src/libcall.cu index c125d82372f7..5f65f9e52730 100644 --- a/openmp/libomptarget/deviceRTLs/common/src/libcall.cu +++ b/openmp/libomptarget/deviceRTLs/common/src/libcall.cu @@ -16,13 +16,13 @@ #include "target_impl.h" EXTERN double omp_get_wtick(void) { - double rc = __target_impl_get_wtick(); + double rc = __kmpc_impl_get_wtick(); PRINT(LD_IO, "omp_get_wtick() returns %g\n", rc); return rc; } EXTERN double omp_get_wtime(void) { - double rc = __target_impl_get_wtime(); + double rc = __kmpc_impl_get_wtime(); PRINT(LD_IO, "call omp_get_wtime() returns %g\n", rc); return rc; } diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h b/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h index c11fe253cc7c..4741ce8218e1 100644 --- a/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h +++ b/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h @@ -102,15 +102,15 @@ INLINE uint32_t __kmpc_impl_smid() { return id; } -INLINE double __target_impl_get_wtick() { +INLINE double __kmpc_impl_get_wtick() { // Timer precision is 1ns return ((double)1E-9); } -INLINE double __target_impl_get_wtime() { +INLINE double __kmpc_impl_get_wtime() { unsigned long long nsecs; asm("mov.u64 %0, %%globaltimer;" : "=l"(nsecs)); - return (double)nsecs * __target_impl_get_wtick(); + return (double)nsecs * __kmpc_impl_get_wtick(); } INLINE uint32_t __kmpc_impl_ffs(uint32_t x) { return __ffs(x); }