[libc-commits] [libc] [libc] Implement `clock_gettime` for the monotonic clock on the GPU (PR #99067)

via libc-commits libc-commits at lists.llvm.org
Tue Jul 16 12:54:42 PDT 2024


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 3cdbb8d74d6fbd298ad4d7d283a3c7bba008e8ef d52779f59adff528b34fdeb8c8e14a557352b759 --extensions cpp,h -- libc/src/time/gpu/clock_gettime.cpp libc/include/llvm-libc-macros/gpu/time-macros.h libc/test/src/time/clock_gettime_test.cpp
``````````

</details>

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

``````````diff
diff --git a/libc/src/time/gpu/clock_gettime.cpp b/libc/src/time/gpu/clock_gettime.cpp
index 7241d5b6e8..de7899a2a1 100644
--- a/libc/src/time/gpu/clock_gettime.cpp
+++ b/libc/src/time/gpu/clock_gettime.cpp
@@ -16,8 +16,7 @@ namespace LIBC_NAMESPACE_DECL {
 
 constexpr uint64_t TICKS_PER_SEC = 1000000000UL;
 
-LLVM_LIBC_FUNCTION(int, clock_gettime,
-                   (clockid_t clockid, timespec *ts)) {
+LLVM_LIBC_FUNCTION(int, clock_gettime, (clockid_t clockid, timespec *ts)) {
   if (clockid != CLOCK_MONOTONIC || !ts)
     return -1;
 

``````````

</details>


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


More information about the libc-commits mailing list