Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libc/config/gpu/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ set(TARGET_LIBC_ENTRYPOINTS
# time.h entrypoints
libc.src.time.clock
libc.src.time.clock_gettime
libc.src.time.timespec_get
libc.src.time.nanosleep

# wchar.h entrypoints
Expand Down
2 changes: 2 additions & 0 deletions libc/src/__support/time/gpu/time_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ extern gpu::Constant<uint64_t> __llvm_libc_clock_freq;
#error "Unsupported target"
#endif

constexpr uint64_t TICKS_PER_SEC = 1000000000UL;

} // namespace LIBC_NAMESPACE_DECL

#endif // LLVM_LIBC_SRC_TIME_GPU_TIME_UTILS_H
2 changes: 0 additions & 2 deletions libc/src/time/gpu/nanosleep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

namespace LIBC_NAMESPACE_DECL {

constexpr uint64_t TICKS_PER_SEC = 1000000000UL;

LLVM_LIBC_FUNCTION(int, nanosleep,
(const struct timespec *req, struct timespec *rem)) {
if (!GPU_CLOCKS_PER_SEC || !req)
Expand Down
1 change: 1 addition & 0 deletions libc/src/time/gpu/timespec_get.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "hdr/time_macros.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/time/gpu/time_utils.h"

namespace LIBC_NAMESPACE_DECL {

Expand Down
Loading