1*ec727ea7Spatrick /*===- __clang_openmp_device_functions.h - OpenMP device function declares -===
2*ec727ea7Spatrick  *
3*ec727ea7Spatrick  * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*ec727ea7Spatrick  * See https://llvm.org/LICENSE.txt for license information.
5*ec727ea7Spatrick  * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*ec727ea7Spatrick  *
7*ec727ea7Spatrick  *===-----------------------------------------------------------------------===
8*ec727ea7Spatrick  */
9*ec727ea7Spatrick 
10*ec727ea7Spatrick #ifndef __CLANG_OPENMP_DEVICE_FUNCTIONS_H__
11*ec727ea7Spatrick #define __CLANG_OPENMP_DEVICE_FUNCTIONS_H__
12*ec727ea7Spatrick 
13*ec727ea7Spatrick #ifndef _OPENMP
14*ec727ea7Spatrick #error "This file is for OpenMP compilation only."
15*ec727ea7Spatrick #endif
16*ec727ea7Spatrick 
17*ec727ea7Spatrick #pragma omp begin declare variant match(                                       \
18*ec727ea7Spatrick     device = {arch(nvptx, nvptx64)}, implementation = {extension(match_any)})
19*ec727ea7Spatrick 
20*ec727ea7Spatrick #ifdef __cplusplus
21*ec727ea7Spatrick extern "C" {
22*ec727ea7Spatrick #endif
23*ec727ea7Spatrick 
24*ec727ea7Spatrick #define __CUDA__
25*ec727ea7Spatrick #define __OPENMP_NVPTX__
26*ec727ea7Spatrick 
27*ec727ea7Spatrick /// Include declarations for libdevice functions.
28*ec727ea7Spatrick #include <__clang_cuda_libdevice_declares.h>
29*ec727ea7Spatrick 
30*ec727ea7Spatrick /// Provide definitions for these functions.
31*ec727ea7Spatrick #include <__clang_cuda_device_functions.h>
32*ec727ea7Spatrick 
33*ec727ea7Spatrick #undef __OPENMP_NVPTX__
34*ec727ea7Spatrick #undef __CUDA__
35*ec727ea7Spatrick 
36*ec727ea7Spatrick #ifdef __cplusplus
37*ec727ea7Spatrick } // extern "C"
38*ec727ea7Spatrick #endif
39*ec727ea7Spatrick 
40*ec727ea7Spatrick #pragma omp end declare variant
41*ec727ea7Spatrick 
42*ec727ea7Spatrick #endif
43