OmniSciDB  04ee39c94c
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 #else
44 #define FORCE_INLINE inline __attribute__((always_inline))
45 #endif
46 
47 #if defined(__CUDACC__) || (defined(__GNUC__) && defined(__SANITIZE_THREAD__)) || \
48  defined(WITH_JIT_DEBUG)
49 #define ALWAYS_INLINE
50 #else
51 #define ALWAYS_INLINE __attribute__((always_inline))
52 #endif
53 
54 #ifdef __CUDACC__
55 #define NEVER_INLINE
56 #else
57 #define NEVER_INLINE __attribute__((noinline))
58 #endif
59 
60 #ifdef __CUDACC__
61 #define SUFFIX(name) name##_gpu
62 #else
63 #define SUFFIX(name) name
64 #endif