Skip to content

Commit 9d0a8ed

Browse files
committed
[libc][NFC] Replace address space with constant GPU utility
Summary: This was written before we had the address space helpers. Using numerical address spaces is bad so this should be removed.
1 parent f42f57b commit 9d0a8ed

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

libc/src/time/gpu/time_utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ namespace LIBC_NAMESPACE {
1515
// insufficient.
1616
// TODO: Once we have another use-case for this we should put it in a common
1717
// device environment struct.
18-
extern "C" [[gnu::visibility("protected")]] uint64_t
19-
[[clang::address_space(4)]] __llvm_libc_clock_freq = clock_freq;
18+
extern "C" [[gnu::visibility("protected")]] gpu::Constant<uint64_t>
19+
__llvm_libc_clock_freq = clock_freq;
2020
#endif
2121

2222
} // namespace LIBC_NAMESPACE

libc/src/time/gpu/time_utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ constexpr uint64_t clock_freq = 100000000UL;
2323

2424
// We provide an externally visible symbol such that the runtime can set
2525
// this to the correct value.
26-
extern "C" [[gnu::visibility("protected")]] uint64_t
27-
[[clang::address_space(4)]] __llvm_libc_clock_freq;
26+
extern "C" [[gnu::visibility("protected")]] gpu::Constant<uint64_t>
27+
__llvm_libc_clock_freq;
2828
#define GPU_CLOCKS_PER_SEC static_cast<clock_t>(__llvm_libc_clock_freq)
2929

3030
#elif defined(LIBC_TARGET_ARCH_IS_NVPTX)

0 commit comments

Comments
 (0)