1//===-- Generic utilities for GPU timing ----------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "time_utils.h"
10#include "src/__support/macros/config.h"
11
12namespace LIBC_NAMESPACE_DECL {
13
14#if defined(LIBC_TARGET_ARCH_IS_AMDGPU)
15// This is expected to be initialized by the runtime if the default value is
16// insufficient.
17// TODO: Once we have another use-case for this we should put it in a common
18// device environment struct.
19gpu::Constant<uint64_t> __llvm_libc_clock_freq = clock_freq;
20#endif
21
22} // namespace LIBC_NAMESPACE_DECL
23

source code of libc/src/__support/time/gpu/time_utils.cpp