OmniSciDB  8a228a1076
funcannotations.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 MapD Technologies, 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(_MSC_VER)
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)
53 #define ALWAYS_INLINE \
54  __attribute__((always_inline)) __attribute__((__visibility__("hidden")))
55 #elif defined(_MSC_VER)
56 #define FORCE_INLINE __forceinline
57 #else
58 #define ALWAYS_INLINE __attribute__((always_inline))
59 #endif
60 
61 #ifdef __CUDACC__
62 #define NEVER_INLINE
63 #elif defined(_MSC_VER)
64 #define NEVER_INLINE __declspec(noinline)
65 #else
66 #define NEVER_INLINE __attribute__((noinline))
67 #endif
68 
69 #ifdef __CUDACC__
70 #define SUFFIX(name) name##_gpu
71 #else
72 #define SUFFIX(name) name
73 #endif