[all-commits] [llvm/llvm-project] 0eb1fc: [libcxx] Set `_LIBCPP_HAS_CLOCK_GETTIME` for GPU t...

Joseph Huber via All-commits all-commits at lists.llvm.org
Wed Aug 14 10:19:29 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0eb1fc88680e2df430a5cb68be5e6a671b43c82d
      https://github.com/llvm/llvm-project/commit/0eb1fc88680e2df430a5cb68be5e6a671b43c82d
  Author: Joseph Huber <huberjn at outlook.com>
  Date:   2024-08-14 (Wed, 14 Aug 2024)

  Changed paths:
    M libcxx/src/chrono.cpp
    M libcxx/src/filesystem/filesystem_clock.cpp

  Log Message:
  -----------
  [libcxx] Set `_LIBCPP_HAS_CLOCK_GETTIME` for GPU targets (#99243)

Summary:
I am attempting to get the GPU to build and support libc++. One issue
I've encountered is that it will look for `timeval` unless this macro is
set. We can support `CLOCK_MONOTONIC` on the GPU fairly easily as we
have access to a fixed-frequency clock via `__builtin_readsteadycounter`
intrinsics with a known frequency. This also requires `CLOCK_REALTIME`
which we can't support, but provide anyway from the GPU `libc` to make
this happy. It will return an error so at least that will be obvious.

I may need a more consistent configuration for this in the future, maybe
I should put a common macro in a different common header that's just
`__GPU__`? I don't know where I would put such a thing however.



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