[libc-commits] [libc] [libc][Obvious] Correctly initialize the default clock frequency (PR #76582)

via libc-commits libc-commits at lists.llvm.org
Fri Dec 29 11:24:34 PST 2023


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 38c9390b59c4d2b9181614d6a909887497d3692f 921b77d2122fb91b39e0de18bd276f5bf270724f -- libc/src/time/gpu/time_utils.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libc/src/time/gpu/time_utils.h b/libc/src/time/gpu/time_utils.h
index 331d0f62f7..1d33e96bd0 100644
--- a/libc/src/time/gpu/time_utils.h
+++ b/libc/src/time/gpu/time_utils.h
@@ -25,7 +25,7 @@ namespace LIBC_NAMESPACE {
     defined(__gfx1150__) || defined(__gfx1151__)
 // These architectures use a 100 MHz fixed frequency clock.
 constexpr uint64_t clock_freq = 100000000;
-                                100000000
+100000000
 #elif defined(__gfx900__) || defined(__gfx902__) || defined(__gfx904__) ||     \
     defined(__gfx906__) || defined(__gfx908__) || defined(__gfx909__) ||       \
     defined(__gfx90a__) || defined(__gfx90c__) || defined(__gfx940__)
@@ -37,9 +37,10 @@ constexpr uint64_t clock_freq = 25000000;
 constexpr uint64_t clock_freq = 0;
 #endif
 
-// We provide an externally visible symbol such that the runtime can set this to
-// the correct value. If it is not set we try to default to the known values.
-extern "C" [[gnu::visibility("protected")]] uint64_t
+    // We provide an externally visible symbol such that the runtime can set
+    // this to the correct value. If it is not set we try to default to the
+    // known values.
+    extern "C" [[gnu::visibility("protected")]] uint64_t
     [[clang::address_space(4)]] __llvm_libc_clock_freq = clock_freq;
 #define GPU_CLOCKS_PER_SEC static_cast<clock_t>(__llvm_libc_clock_freq)
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/76582


More information about the libc-commits mailing list