|
| 1 | +/* |
| 2 | + * Copyright 1993-2022 NVIDIA Corporation. All rights reserved. |
| 3 | + * |
| 4 | + * NOTICE TO LICENSEE: |
| 5 | + * |
| 6 | + * This source code and/or documentation ("Licensed Deliverables") are |
| 7 | + * subject to NVIDIA intellectual property rights under U.S. and |
| 8 | + * international Copyright laws. |
| 9 | + * |
| 10 | + * These Licensed Deliverables contained herein is PROPRIETARY and |
| 11 | + * CONFIDENTIAL to NVIDIA and is being provided under the terms and |
| 12 | + * conditions of a form of NVIDIA software license agreement by and |
| 13 | + * between NVIDIA and Licensee ("License Agreement") or electronically |
| 14 | + * accepted by Licensee. Notwithstanding any terms or conditions to |
| 15 | + * the contrary in the License Agreement, reproduction or disclosure |
| 16 | + * of the Licensed Deliverables to any third party without the express |
| 17 | + * written consent of NVIDIA is prohibited. |
| 18 | + * |
| 19 | + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE |
| 20 | + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE |
| 21 | + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS |
| 22 | + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. |
| 23 | + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED |
| 24 | + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, |
| 25 | + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. |
| 26 | + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE |
| 27 | + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY |
| 28 | + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY |
| 29 | + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, |
| 30 | + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS |
| 31 | + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE |
| 32 | + * OF THESE LICENSED DELIVERABLES. |
| 33 | + * |
| 34 | + * U.S. Government End Users. These Licensed Deliverables are a |
| 35 | + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT |
| 36 | + * 1995), consisting of "commercial computer software" and "commercial |
| 37 | + * computer software documentation" as such terms are used in 48 |
| 38 | + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government |
| 39 | + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and |
| 40 | + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all |
| 41 | + * U.S. Government End Users acquire the Licensed Deliverables with |
| 42 | + * only those rights set forth herein. |
| 43 | + * |
| 44 | + * Any use of the Licensed Deliverables in individual and commercial |
| 45 | + * software must include, in the user documentation and internal |
| 46 | + * comments to the code, the above Disclaimer and U.S. Government End |
| 47 | + * Users Notice. |
| 48 | + */ |
| 49 | + |
| 50 | +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) |
| 51 | +#if defined(_MSC_VER) |
| 52 | +#pragma message("crt/host_defines.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") |
| 53 | +#else |
| 54 | +#warning "crt/host_defines.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." |
| 55 | +#endif |
| 56 | +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ |
| 57 | +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_HOST_DEFINES_H__ |
| 58 | +#endif |
| 59 | + |
| 60 | +#if !defined(__HOST_DEFINES_H__) |
| 61 | +#define __HOST_DEFINES_H__ |
| 62 | + |
| 63 | +/* CUDA JIT mode (__CUDACC_RTC__) also uses GNU style attributes */ |
| 64 | +#if defined(__GNUC__) || (defined(__PGIC__) && defined(__linux__)) || defined(__CUDA_LIBDEVICE__) || defined(__CUDACC_RTC__) |
| 65 | + |
| 66 | +#if defined(__CUDACC_RTC__) |
| 67 | +#define __volatile__ volatile |
| 68 | +#endif /* __CUDACC_RTC__ */ |
| 69 | + |
| 70 | +#define __no_return__ \ |
| 71 | + __attribute__((noreturn)) |
| 72 | + |
| 73 | +#if defined(__CUDACC__) || defined(__CUDA_ARCH__) || defined(__CUDA_LIBDEVICE__) |
| 74 | +/* gcc allows users to define attributes with underscores, |
| 75 | + e.g., __attribute__((__noinline__)). |
| 76 | + Consider a non-CUDA source file (e.g. .cpp) that has the |
| 77 | + above attribute specification, and includes this header file. In that case, |
| 78 | + defining __noinline__ as below would cause a gcc compilation error. |
| 79 | + Hence, only define __noinline__ when the code is being processed |
| 80 | + by a CUDA compiler component. |
| 81 | +*/ |
| 82 | +#define __noinline__ \ |
| 83 | + __attribute__((noinline)) |
| 84 | +#endif /* __CUDACC__ || __CUDA_ARCH__ || __CUDA_LIBDEVICE__ */ |
| 85 | + |
| 86 | +#define __forceinline__ \ |
| 87 | + __inline__ __attribute__((always_inline)) |
| 88 | +#define __align__(n) \ |
| 89 | + __attribute__((aligned(n))) |
| 90 | +#define __thread__ \ |
| 91 | + __thread |
| 92 | +#define __import__ |
| 93 | +#define __export__ |
| 94 | +#define __cdecl |
| 95 | +#define __annotate__(a) \ |
| 96 | + __attribute__((a)) |
| 97 | +#define __location__(a) \ |
| 98 | + __annotate__(a) |
| 99 | +#define CUDARTAPI |
| 100 | +#define CUDARTAPI_CDECL |
| 101 | + |
| 102 | +#elif defined(_MSC_VER) |
| 103 | + |
| 104 | +#if _MSC_VER >= 1400 |
| 105 | + |
| 106 | +#define __restrict__ \ |
| 107 | + __restrict |
| 108 | + |
| 109 | +#else /* _MSC_VER >= 1400 */ |
| 110 | + |
| 111 | +#define __restrict__ |
| 112 | + |
| 113 | +#endif /* _MSC_VER >= 1400 */ |
| 114 | + |
| 115 | +#define __inline__ \ |
| 116 | + __inline |
| 117 | +#define __no_return__ \ |
| 118 | + __declspec(noreturn) |
| 119 | +#define __noinline__ \ |
| 120 | + __declspec(noinline) |
| 121 | +#define __forceinline__ \ |
| 122 | + __forceinline |
| 123 | +#define __align__(n) \ |
| 124 | + __declspec(align(n)) |
| 125 | +#define __thread__ \ |
| 126 | + __declspec(thread) |
| 127 | +#define __import__ \ |
| 128 | + __declspec(dllimport) |
| 129 | +#define __export__ \ |
| 130 | + __declspec(dllexport) |
| 131 | +#define __annotate__(a) \ |
| 132 | + __declspec(a) |
| 133 | +#define __location__(a) \ |
| 134 | + __annotate__(__##a##__) |
| 135 | +#define CUDARTAPI \ |
| 136 | + __stdcall |
| 137 | +#define CUDARTAPI_CDECL \ |
| 138 | + __cdecl |
| 139 | + |
| 140 | +#else /* __GNUC__ || __CUDA_LIBDEVICE__ || __CUDACC_RTC__ */ |
| 141 | + |
| 142 | +#define __inline__ |
| 143 | + |
| 144 | +#if !defined(__align__) |
| 145 | + |
| 146 | +#error --- !!! UNKNOWN COMPILER: please provide a CUDA compatible definition for '__align__' !!! --- |
| 147 | + |
| 148 | +#endif /* !__align__ */ |
| 149 | + |
| 150 | +#if !defined(CUDARTAPI) |
| 151 | + |
| 152 | +#error --- !!! UNKNOWN COMPILER: please provide a CUDA compatible definition for 'CUDARTAPI' !!! --- |
| 153 | + |
| 154 | +#endif /* !CUDARTAPI */ |
| 155 | + |
| 156 | +#endif /* __GNUC__ || __CUDA_LIBDEVICE__ || __CUDACC_RTC__ */ |
| 157 | + |
| 158 | +#if (defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3 && !defined(__clang__)))) || \ |
| 159 | + (defined(_MSC_VER) && _MSC_VER < 1900) || \ |
| 160 | + (!defined(__GNUC__) && !defined(_MSC_VER)) |
| 161 | + |
| 162 | +#define __specialization_static \ |
| 163 | + static |
| 164 | + |
| 165 | +#else /* (__GNUC__ && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3 && !__clang__))) || |
| 166 | + (_MSC_VER && _MSC_VER < 1900) || |
| 167 | + (!__GNUC__ && !_MSC_VER) */ |
| 168 | + |
| 169 | +#define __specialization_static |
| 170 | + |
| 171 | +#endif /* (__GNUC__ && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3 && !__clang__))) || |
| 172 | + (_MSC_VER && _MSC_VER < 1900) || |
| 173 | + (!__GNUC__ && !_MSC_VER) */ |
| 174 | + |
| 175 | +#if !defined(__CUDACC__) && !defined(__CUDA_LIBDEVICE__) |
| 176 | + |
| 177 | +#undef __annotate__ |
| 178 | +#define __annotate__(a) |
| 179 | + |
| 180 | +#else /* !__CUDACC__ && !__CUDA_LIBDEVICE__ */ |
| 181 | + |
| 182 | +#define __launch_bounds__(...) \ |
| 183 | + __annotate__(launch_bounds(__VA_ARGS__)) |
| 184 | + |
| 185 | +#endif /* !__CUDACC__ && !__CUDA_LIBDEVICE__ */ |
| 186 | + |
| 187 | +#if defined(__CUDACC__) || defined(__CUDA_LIBDEVICE__) || \ |
| 188 | + defined(__GNUC__) || defined(_WIN64) |
| 189 | + |
| 190 | +#define __builtin_align__(a) \ |
| 191 | + __align__(a) |
| 192 | + |
| 193 | +#else /* __CUDACC__ || __CUDA_LIBDEVICE__ || __GNUC__ || _WIN64 */ |
| 194 | + |
| 195 | +#define __builtin_align__(a) |
| 196 | + |
| 197 | +#endif /* __CUDACC__ || __CUDA_LIBDEVICE__ || __GNUC__ || _WIN64 */ |
| 198 | + |
| 199 | +#if defined(__CUDACC__) || !defined(__grid_constant__) |
| 200 | +#define __grid_constant__ \ |
| 201 | + __location__(grid_constant) |
| 202 | +#endif /* defined(__CUDACC__) || !defined(__grid_constant__) */ |
| 203 | + |
| 204 | +#if defined(__CUDACC__) || !defined(__host__) |
| 205 | +#define __host__ \ |
| 206 | + __location__(host) |
| 207 | +#endif /* defined(__CUDACC__) || !defined(__host__) */ |
| 208 | +#if defined(__CUDACC__) || !defined(__device__) |
| 209 | +#define __device__ \ |
| 210 | + __location__(device) |
| 211 | +#endif /* defined(__CUDACC__) || !defined(__device__) */ |
| 212 | +#if defined(__CUDACC__) || !defined(__global__) |
| 213 | +#define __global__ \ |
| 214 | + __location__(global) |
| 215 | +#endif /* defined(__CUDACC__) || !defined(__global__) */ |
| 216 | +#if defined(__CUDACC__) || !defined(__shared__) |
| 217 | +#define __shared__ \ |
| 218 | + __location__(shared) |
| 219 | +#endif /* defined(__CUDACC__) || !defined(__shared__) */ |
| 220 | +#if defined(__CUDACC__) || !defined(__constant__) |
| 221 | +#define __constant__ \ |
| 222 | + __location__(constant) |
| 223 | +#endif /* defined(__CUDACC__) || !defined(__constant__) */ |
| 224 | +#if defined(__CUDACC__) || !defined(__managed__) |
| 225 | +#define __managed__ \ |
| 226 | + __location__(managed) |
| 227 | +#endif /* defined(__CUDACC__) || !defined(__managed__) */ |
| 228 | + |
| 229 | +#if !defined(__CUDACC__) |
| 230 | +#define __device_builtin__ |
| 231 | +#define __device_builtin_texture_type__ |
| 232 | +#define __device_builtin_surface_type__ |
| 233 | +#define __cudart_builtin__ |
| 234 | +#else /* defined(__CUDACC__) */ |
| 235 | +#define __device_builtin__ \ |
| 236 | + __location__(device_builtin) |
| 237 | +#define __device_builtin_texture_type__ \ |
| 238 | + __location__(device_builtin_texture_type) |
| 239 | +#define __device_builtin_surface_type__ \ |
| 240 | + __location__(device_builtin_surface_type) |
| 241 | +#define __cudart_builtin__ \ |
| 242 | + __location__(cudart_builtin) |
| 243 | +#endif /* !defined(__CUDACC__) */ |
| 244 | + |
| 245 | +#if defined(__CUDACC__) || !defined(__cluster_dims__) |
| 246 | +#if defined(_MSC_VER) |
| 247 | +#define __cluster_dims__(...) \ |
| 248 | + __declspec(__cluster_dims__(__VA_ARGS__)) |
| 249 | + |
| 250 | +#else /* !defined(_MSC_VER) */ |
| 251 | +#define __cluster_dims__(...) \ |
| 252 | + __attribute__((cluster_dims(__VA_ARGS__))) |
| 253 | +#endif /* defined(_MSC_VER) */ |
| 254 | +#endif /* defined(__CUDACC__) || !defined(__cluster_dims__) */ |
| 255 | + |
| 256 | +#define __CUDA_ARCH_HAS_FEATURE__(_FEAT) __CUDA_ARCH_FEAT_##_FEAT |
| 257 | + |
| 258 | +#endif /* !__HOST_DEFINES_H__ */ |
| 259 | + |
| 260 | +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_HOST_DEFINES_H__) |
| 261 | +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ |
| 262 | +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_HOST_DEFINES_H__ |
| 263 | +#endif |
0 commit comments