OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
funcannotations.h
Go to the documentation of this file.
1 /*
2  * Copyright 2022 HEAVY.AI, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifdef __CUDACC__
18 #define DEVICE __device__
19 #else
20 #define DEVICE
21 #endif
22 
23 #ifdef __CUDACC__
24 #define HOST __host__
25 #else
26 #define HOST
27 #endif
28 
29 #ifdef __CUDACC__
30 #define GLOBAL __global__
31 #else
32 #define GLOBAL
33 #endif
34 
35 #if defined(__CUDACC__) && __CUDACC_VER_MAJOR__ < 8
36 #define STATIC_QUAL
37 #else
38 #define STATIC_QUAL static
39 #endif
40 
41 #ifdef __CUDACC__
42 #define FORCE_INLINE __forceinline__
43 #elif defined(_WIN32)
44 #define FORCE_INLINE __forceinline
45 #else
46 #define FORCE_INLINE inline __attribute__((always_inline))
47 #endif
48 
49 #if defined(__CUDACC__) || (defined(__GNUC__) && defined(__SANITIZE_THREAD__)) || \
50  defined(WITH_JIT_DEBUG)
51 #define ALWAYS_INLINE
52 #elif defined(ENABLE_EMBEDDED_DATABASE) && !defined(_WIN32)
53 #define ALWAYS_INLINE __attribute__((inline)) __attribute__((__visibility__("protected")))
54 #elif defined(_WIN32)
55 #define ALWAYS_INLINE __inline
56 #else
57 #define ALWAYS_INLINE __attribute__((always_inline))
58 #endif
59 
60 #ifdef __CUDACC__
61 #define NEVER_INLINE
62 #elif defined(_WIN32)
63 #define NEVER_INLINE __declspec(noinline)
64 #else
65 #define NEVER_INLINE __attribute__((noinline))
66 #endif
67 
68 #ifdef __CUDACC__
69 #define SUFFIX(name) name##_gpu
70 #else
71 #define SUFFIX(name) name
72 #endif
73 
74 #ifdef _WIN32
75 #define RUNTIME_EXPORT __declspec(dllexport)
76 #else
77 #define RUNTIME_EXPORT
78 #endif