[flang][cuda] Do not register global constants (#118582)
[llvm-project.git] / clang / lib / Headers / openmp_wrappers / time.h
blobc760dd1ed963ade43cfde7a88536b968f9da0d8c
1 /*===---- time.h - OpenMP time header wrapper ------------------------ c ---===
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
7 *===-----------------------------------------------------------------------===
8 */
10 #ifndef __CLANG_OPENMP_TIME_H__
11 #define __CLANG_OPENMP_TIME_H__
13 #ifndef _OPENMP
14 #error "This file is for OpenMP compilation only."
15 #endif
17 #if defined(__cplusplus)
18 #define __DEVICE__ static constexpr __attribute__((always_inline, nothrow))
19 #else
20 #define __DEVICE__ static __attribute__((always_inline, nothrow))
21 #endif
23 #include_next <time.h>
25 #pragma omp begin declare variant match( \
26 device = {arch(nvptx, nvptx64)}, implementation = {extension(match_any)})
28 __DEVICE__ clock_t clock() { return __nvvm_read_ptx_sreg_clock(); }
30 #pragma omp end declare variant
32 #endif