30 #ifndef NV_NVFOUNDATION_NVPREPROCESSOR_H 31 #define NV_NVFOUNDATION_NVPREPROCESSOR_H 50 #elif _MSC_VER >= 1800 52 #elif _MSC_VER >= 1700 54 #elif _MSC_VER >= 1600 56 #elif _MSC_VER >= 1500 59 #error "Unknown VC version" 61 #elif defined(__clang__) 63 #elif defined(__SNC__) 65 #elif defined(__ghs__) 67 #elif defined(__GNUC__) // note: __clang__, __SNC__, or __ghs__ imply __GNUC__ 70 #error "Unknown compiler" 76 #if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_PARTITION_APP 77 #define NV_WINRT 1 // Windows Runtime, either on Windows RT or Windows 8 78 #elif defined(XBOXONE) || defined(_XBOX_ONE) 80 #elif defined(_WIN64) // note: XBOXONE implies _WIN64 84 #elif defined(_WIN32) // note: _M_PPC implies _WIN32 86 #elif defined(__ANDROID__) 88 #elif defined(__linux__) // note: __ANDROID__ implies __linux__ 90 #elif defined(__APPLE__) && (defined(__arm__) || defined(__arm64__)) 92 #elif defined(__APPLE__) 94 #elif defined(__CELLOS_LV2__) 96 #elif defined(__ORBIS__) 98 #elif defined(__SNC__) && defined(__arm__) 100 #elif defined(__ghs__) 103 #error "Unknown operating system" 109 #if defined(__x86_64__) || defined(_M_X64) // ps4 compiler defines _M_X64 without value 111 #elif defined(__i386__) || defined(_M_IX86) 113 #elif defined(__arm64__) || defined(__aarch64__) 115 #elif defined(__arm__) || defined(_M_ARM) 117 #elif defined(__SPU__) 119 #elif defined(__ppc__) || defined(_M_PPC) || defined(__CELLOS_LV2__) 122 #error "Unknown architecture" 128 #if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64) 131 #if defined(_M_ARM) || defined(__ARM_NEON__) 134 #if defined(_M_PPC) || defined(__CELLOS_LV2__) 246 #define NV_GCC_FAMILY (NV_CLANG || NV_SNC || NV_GHS || NV_GCC) 248 #define NV_WINDOWS_FAMILY (NV_WINRT || NV_WIN32 || NV_WIN64) 249 #define NV_MICROSOFT_FAMILY (NV_XBOXONE || NV_X360 || NV_WINDOWS_FAMILY) 250 #define NV_LINUX_FAMILY (NV_LINUX || NV_ANDROID) 251 #define NV_APPLE_FAMILY (NV_IOS || NV_OSX) // equivalent to #if __APPLE__ 252 #define NV_UNIX_FAMILY (NV_LINUX_FAMILY || NV_APPLE_FAMILY) // shortcut for unix/posix platforms 254 #define NV_INTEL_FAMILY (NV_X64 || NV_X86) 255 #define NV_ARM_FAMILY (NV_ARM || NV_A64) 256 #define NV_P64_FAMILY (NV_X64 || NV_A64) // shortcut for 64-bit architectures 259 #define NV_PPU (NV_PS3&& NV_PPC) 264 #ifndef NV_ENABLE_ASSERTS 265 #if NV_DEBUG && !defined(__CUDACC__) 266 #define NV_ENABLE_ASSERTS 1 268 #define NV_ENABLE_ASSERTS 0 276 #if NV_WINDOWS_FAMILY || NV_LINUX || NV_PS4 || NV_XBOXONE 277 #define NV_C_EXPORT extern "C" 283 #if NV_UNIX_FAMILY && __GNUC__ >= 4 284 #define NV_UNIX_EXPORT __attribute__((visibility("default"))) 286 #define NV_UNIX_EXPORT 289 #if NV_WINDOWS_FAMILY 290 #define NV_DLL_EXPORT __declspec(dllexport) 291 #define NV_DLL_IMPORT __declspec(dllimport) 293 #define NV_DLL_EXPORT NV_UNIX_EXPORT 294 #define NV_DLL_IMPORT 306 #if NV_WINDOWS_FAMILY && !NV_ARM_FAMILY || NV_WINRT 307 #ifndef NV_FOUNDATION_DLL 308 #define NV_FOUNDATION_API NV_DLL_IMPORT 309 #elif NV_FOUNDATION_DLL 310 #define NV_FOUNDATION_API NV_DLL_EXPORT 313 #ifdef NV_FOUNDATION_DLL 314 #define NV_FOUNDATION_API NV_UNIX_EXPORT 318 #ifndef NV_FOUNDATION_API 319 #define NV_FOUNDATION_API 326 #if NV_MICROSOFT_FAMILY 327 #define NV_CALL_CONV __cdecl 337 #define NV_PUSH_PACK_DEFAULT __pragma(pack(push, 8)) 338 #define NV_POP_PACK __pragma(pack(pop)) 339 #elif NV_GCC_FAMILY && !NV_SPU 340 #define NV_PUSH_PACK_DEFAULT _Pragma("pack(push, 8)") 341 #define NV_POP_PACK _Pragma("pack(pop)") 343 #define NV_PUSH_PACK_DEFAULT 350 #define NV_INLINE inline 351 #if NV_MICROSOFT_FAMILY 352 #pragma inline_depth(255) 359 #define NV_FORCE_INLINE __forceinline 360 #elif NV_LINUX // Workaround; Fedora Core 3 do not agree with force inline and NvcPool 361 #define NV_FORCE_INLINE inline 363 #define NV_FORCE_INLINE inline __attribute__((always_inline)) 365 #define NV_FORCE_INLINE inline 371 #if NV_MICROSOFT_FAMILY 372 #define NV_NOINLINE __declspec(noinline) 374 #define NV_NOINLINE __attribute__((noinline)) 382 #if defined(__CUDACC__) 383 #define NV_RESTRICT __restrict__ 385 #define NV_RESTRICT __restrict 391 #if NV_MICROSOFT_FAMILY 392 #define NV_NOALIAS __declspec(noalias) 409 #if NV_MICROSOFT_FAMILY 410 #define NV_ALIGN(alignment, decl) __declspec(align(alignment)) decl 411 #define NV_ALIGN_PREFIX(alignment) __declspec(align(alignment)) 412 #define NV_ALIGN_SUFFIX(alignment) 414 #define NV_ALIGN(alignment, decl) decl __attribute__((aligned(alignment))) 415 #define NV_ALIGN_PREFIX(alignment) 416 #define NV_ALIGN_SUFFIX(alignment) __attribute__((aligned(alignment))) 418 #define NV_ALIGN(alignment, decl) 419 #define NV_ALIGN_PREFIX(alignment) 420 #define NV_ALIGN_SUFFIX(alignment) 434 #define NV_DEPRECATED 441 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) || defined(__ORBIS__) 442 #define NV_COMPILE_TIME_ASSERT(exp) typedef char NvCompileTimeAssert_Dummy[(exp) ? 1 : -1] __attribute__((unused)) 444 #define NV_COMPILE_TIME_ASSERT(exp) typedef char NvCompileTimeAssert_Dummy[(exp) ? 1 : -1] 447 #if NV_GCC_FAMILY && !NV_SNC && !NV_GHS 448 #define NV_OFFSET_OF(X, Y) __builtin_offsetof(X, Y) 450 #define NV_OFFSET_OF(X, Y) offsetof(X, Y) 453 #define NV_OFFSETOF_BASE 0x100 // casting the null ptr takes a special-case code path, which we don't want 454 #define NV_OFFSET_OF_RT(Class, Member) \ 455 (reinterpret_cast<size_t>(&reinterpret_cast<Class*>(NV_OFFSETOF_BASE)->Member) - size_t(NV_OFFSETOF_BASE)) 458 #if !defined(NDEBUG) ^ defined(_DEBUG) 459 #error Exactly one of NDEBUG and _DEBUG needs to be defined! 463 #if !defined(NV_CHECKED) && defined(NV_DEBUG) 464 #error NV_CHECKED must be defined when NV_DEBUG is defined 468 #define NV_CUDA_CALLABLE __host__ __device__ 470 #define NV_CUDA_CALLABLE 485 #if NV_PS4 || NV_APPLE_FAMILY 510 #define NV_DUMMY_SYMBOL \ 513 char NvDummySymbol; \ 516 #define NV_DUMMY_SYMBOL 519 #if NV_GCC_FAMILY && !NV_GHS 520 #define NV_WEAK_SYMBOL __attribute__((weak)) // this is to support SIMD constant merging in template specialization 522 #define NV_WEAK_SYMBOL 527 #define NV_NOCOPY(Class) \ 530 Class(const Class&); \ 531 Class& operator=(const Class&); 533 #define NV_STRINGIZE_HELPER(X) #X 534 #define NV_STRINGIZE(X) NV_STRINGIZE_HELPER(X) 536 #define NV_CONCAT_HELPER(X, Y) X##Y 537 #define NV_CONCAT(X, Y) NV_CONCAT_HELPER(X, Y) 540 #endif // #ifndef NV_NVFOUNDATION_NVPREPROCESSOR_H #define NV_COMPILE_TIME_ASSERT(exp)
Definition: NvPreprocessor.h:444
NV_CUDA_CALLABLE NV_INLINE void NV_UNUSED(T const &)
Definition: NvPreprocessor.h:476
#define NV_OFFSET_OF(X, Y)
Definition: NvPreprocessor.h:450
#define NV_CUDA_CALLABLE
Definition: NvPreprocessor.h:470
char _
Definition: NvPreprocessor.h:500
long long a
Definition: NvPreprocessor.h:501
#define NV_INLINE
Definition: NvPreprocessor.h:350
Definition: NvPreprocessor.h:498