[libc] Fix constant variable initializer

This commit is contained in:
Joseph Huber 2024-05-16 15:24:23 -05:00
parent 9d0a8eda0b
commit 61565abcdc
2 changed files with 3 additions and 4 deletions

View File

@ -15,8 +15,8 @@ namespace LIBC_NAMESPACE {
// insufficient.
// TODO: Once we have another use-case for this we should put it in a common
// device environment struct.
extern "C" [[gnu::visibility("protected")]] gpu::Constant<uint64_t>
__llvm_libc_clock_freq = clock_freq;
extern "C" [[gnu::visibility("protected")]] uint64_t __llvm_libc_clock_freq =
clock_freq;
#endif
} // namespace LIBC_NAMESPACE

View File

@ -23,8 +23,7 @@ constexpr uint64_t clock_freq = 100000000UL;
// We provide an externally visible symbol such that the runtime can set
// this to the correct value.
extern "C" [[gnu::visibility("protected")]] gpu::Constant<uint64_t>
__llvm_libc_clock_freq;
extern "C" [[gnu::visibility("protected")]] uint64_t __llvm_libc_clock_freq;
#define GPU_CLOCKS_PER_SEC static_cast<clock_t>(__llvm_libc_clock_freq)
#elif defined(LIBC_TARGET_ARCH_IS_NVPTX)