[all-commits] [llvm/llvm-project] 8393ea: [libc] Implement `clock_gettime` for the monotonic...

Joseph Huber via All-commits all-commits at lists.llvm.org
Tue Jul 16 14:17:56 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8393ea5d1dd8e8b56a87a6edbca31fb8722cee48
      https://github.com/llvm/llvm-project/commit/8393ea5d1dd8e8b56a87a6edbca31fb8722cee48
  Author: Joseph Huber <huberjn at outlook.com>
  Date:   2024-07-16 (Tue, 16 Jul 2024)

  Changed paths:
    M libc/config/gpu/entrypoints.txt
    M libc/docs/gpu/support.rst
    M libc/include/llvm-libc-macros/gpu/time-macros.h
    M libc/include/time.h.def
    M libc/src/time/gpu/CMakeLists.txt
    A libc/src/time/gpu/clock_gettime.cpp
    M libc/test/src/time/CMakeLists.txt
    M libc/test/src/time/clock_gettime_test.cpp

  Log Message:
  -----------
  [libc] Implement `clock_gettime` for the monotonic clock on the GPU (#99067)

Summary:
This patch implements `clock_gettime` using the monotonic clock. This
allows users to get time elapsed at nanosecond resolution. This is
primarily to facilitate compiling the `chrono` library from `libc++`.
For this reason we provide both `CLOCK_MONOTONIC`, which we can
implement
with the GPU's global fixed-frequency clock, and `CLOCK_REALTIME` which
we cannot. The latter is provided just to make people who use this
header happy and it will always return failure.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list