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 *===-----------------------------------------------------------------------===
10 #ifndef __CLANG_OPENMP_TIME_H__
11 #define __CLANG_OPENMP_TIME_H__
14 #error "This file is for OpenMP compilation only."
17 #if defined(__cplusplus)
18 #define __DEVICE__ static constexpr __attribute__((always_inline, nothrow))
20 #define __DEVICE__ static __attribute__((always_inline, nothrow))
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