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
11namespace LIBC_NAMESPACE {
12
13#if defined(LIBC_TARGET_ARCH_IS_AMDGPU)
14// This is expected to be initialized by the runtime if the default value is
15// insufficient.
16// TODO: Once we have another use-case for this we should put it in a common
17// device environment struct.
18extern "C" [[gnu::visibility("protected")]] uint64_t
19 [[clang::address_space(4)]] __llvm_libc_clock_freq = clock_freq;
20#endif
21
22} // namespace LIBC_NAMESPACE
23

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