brintos

brintos / llvm-project-archived public Read only

0
0
Text · 986 B · c760dd1 Raw
33 lines · c
1/*===---- time.h - OpenMP time header wrapper ------------------------ c ---===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-exception6 *7 *===-----------------------------------------------------------------------===8 */9 10#ifndef __CLANG_OPENMP_TIME_H__11#define __CLANG_OPENMP_TIME_H__12 13#ifndef _OPENMP14#error "This file is for OpenMP compilation only."15#endif16 17#if defined(__cplusplus)18#define __DEVICE__ static constexpr __attribute__((always_inline, nothrow))19#else20#define __DEVICE__ static __attribute__((always_inline, nothrow))21#endif22 23#include_next <time.h>24 25#pragma omp begin declare variant match(                                       \26    device = {arch(nvptx, nvptx64)}, implementation = {extension(match_any)})27 28__DEVICE__ clock_t clock() { return __nvvm_read_ptx_sreg_clock(); }29 30#pragma omp end declare variant31 32#endif33