소스 검색

wall_clock: Increase precision requirements

We are providing a conversion to nanoseconds in NativeClock, which is more precise than the GPU tick.
Morph 3 년 전
부모
커밋
bb4e676155
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/common/wall_clock.cpp

+ 2 - 2
src/common/wall_clock.cpp

@@ -56,12 +56,12 @@ std::unique_ptr<WallClock> CreateOptimalClock() {
 #ifdef ARCHITECTURE_x86_64
     const auto& caps = GetCPUCaps();
 
-    if (caps.invariant_tsc && caps.tsc_frequency >= WallClock::GPUTickFreq) {
+    if (caps.invariant_tsc && caps.tsc_frequency >= std::nano::den) {
         return std::make_unique<X64::NativeClock>(caps.tsc_frequency);
     } else {
         // Fallback to StandardWallClock if the hardware TSC
         // - Is not invariant
-        // - Is not more precise than GPUTickFreq
+        // - Is not more precise than 1 GHz (1ns resolution)
         return std::make_unique<StandardWallClock>();
     }
 #else