Go to the documentation of this file.
9#ifndef MI_BASE_CONFIG_H
10#define MI_BASE_CONFIG_H
23#define MI_COPYRIGHT_YEARS_STRING "2024"
26#define MI_COPYRIGHT_COMPANY_STRING "NVIDIA Corporation"
29#define MI_COPYRIGHT_COPYRIGHT_STRING \
30"Copyright " MI_COPYRIGHT_YEARS_STRING \
31" "
MI_COPYRIGHT_COMPANY_STRING ". All rights reserved."
34#define MI_COPYRIGHT_PORTIONS_STRING \
35"Portions " MI_COPYRIGHT_COPYRIGHT_STRING
70# define MI_DLL_EXPORT __declspec(dllexport)
72# define MI_DLL_EXPORT __declspec(dllimport)
75#elif defined(__GNUC__) && !defined(__ICC)
76# define MI_DLL_EXPORT __attribute__ ((visibility("default")))
77# define MI_DLL_LOCAL __attribute__ ((visibility("hidden")))
85#define MI_BASE_JOIN( X, Y ) MI_BASE_DO_JOIN( X, Y )
86#define MI_BASE_DO_JOIN( X, Y ) MI_BASE_DO_JOIN2(X,Y)
87#define MI_BASE_DO_JOIN2( X, Y ) X##Y
90#define MI_BASE_STRINGIZE( X ) MI_BASE_DO_STRINGIZE( X )
91#define MI_BASE_DO_STRINGIZE( X ) MI_BASE_DO_STRINGIZE2(X)
92#define MI_BASE_DO_STRINGIZE2( X ) #X
97#define MI_PREVENT_MACRO_EXPAND
103#if !defined(MI_PLATFORM_WINDOWS)
104#define MI_PLATFORM_WINDOWS
109#if !defined(MI_PLATFORM_WIN64)
110#define MI_PLATFORM_WIN64
115#if !defined(MI_PLATFORM_WIN32)
116#define MI_PLATFORM_WIN32
121#elif defined(__APPLE__)
123#if !defined(MI_PLATFORM_MACOSX)
124#define MI_PLATFORM_MACOSX
127#elif defined(__unix__)
129#if !defined(MI_PLATFORM_UNIX)
130#define MI_PLATFORM_UNIX
133#if defined(__x86_64__)
135#if !defined(MI_PLATFORM_UNIX64)
136#define MI_PLATFORM_UNIX64
141#if !defined(MI_PLATFORM_UNIX32)
142#define MI_PLATFORM_UNIX32
147#if defined(__linux__)
149#if !defined(MI_PLATFORM_LINUX)
150#define MI_PLATFORM_LINUX
163#ifndef MI_SKIP_COMPILER_VERSION_CHECK
165#error Microsoft Visual C++ compiler version is unsupported (smaller than 1400).
169#if !defined(MI_COMPILER_MSC)
170#define MI_COMPILER_MSC _MSC_VER
175#ifndef MI_SKIP_COMPILER_VERSION_CHECK
177#error Intel C++ compiler version is unsupported (smaller than 900).
181#if !defined(MI_COMPILER_ICC)
182#define MI_COMPILER_ICC __ICC
186#elif defined(__GNUC__) && defined(__clang__)
188#ifndef MI_SKIP_COMPILER_VERSION_CHECK
189#if !defined(MI_COMPILER_CLANG)
190#define MI_COMPILER_CLANG __clang__
193#if !defined(MI_COMPILER_GCC)
194#define MI_COMPILER_GCC __GNUC__
198#elif defined(__GNUC__) && !defined(__ICC)
200#ifndef MI_SKIP_COMPILER_VERSION_CHECK
201#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ < 3)))
202#error GNU C++ compiler version is unsupported (smaller than 3.3).
205#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ < 4)))
206#warning GNU C++ compiler version is unsupported (smaller than 3.4).
210#if !defined(MI_COMPILER_GCC)
211#define MI_COMPILER_GCC __GNUC__
220#if defined(_M_IX86) || defined(__i386__) || defined(__x86_64__) || defined(_M_X64)
222#if !defined(MI_ARCH_X86)
226#if (defined(__x86_64__) || defined(_M_X64) ) && !defined(MI_ARCH_X86_64)
227#define MI_ARCH_X86_64
230#if !defined(MI_ARCH_LITTLE_ENDIAN)
231#define MI_ARCH_LITTLE_ENDIAN
234#elif defined(__sparcv9)
236#if ! defined( MI_ARCH_SPARC_64)
237#define MI_ARCH_SPARC_64
240#if !defined(MI_ARCH_BIG_ENDIAN)
241#define MI_ARCH_BIG_ENDIAN
244#elif defined(__powerpc64__)
246#if !defined(MI_ARCH_POWERPC_64)
247#define MI_ARCH_POWERPC_64
250#if !defined(__LITTLE_ENDIAN__)
251#error Architecture POWERPC_64 is only supported in little endian mode.
254#if !defined(MI_ARCH_LITTLE_ENDIAN)
255#define MI_ARCH_LITTLE_ENDIAN
258#elif defined(__aarch64__) || defined(_M_ARM64)
260#if !defined(MI_ARCH_ARM_64)
261#define MI_ARCH_ARM_64
264#if !defined(__AARCH64EL__) && !defined(_M_ARM64)
265#error Architecture ARM_64 is only supported in little endian mode.
268#if !defined(MI_ARCH_LITTLE_ENDIAN)
269#define MI_ARCH_LITTLE_ENDIAN
274#if defined(MI_ARCH_X86_64) \
275 || defined(MI_ARCH_SPARC_64) \
276 || defined(MI_ARCH_POWERPC_64) \
277 || defined(MI_ARCH_ARM_64)
282#if ! defined(MI_ARCH_BIG_ENDIAN) && ! defined(MI_ARCH_LITTLE_ENDIAN)
283#error Architecture unknown, neither big-endian nor little-endian detected.
299#if defined(__cplusplus) && !defined(MI_FORCE_INLINE)
300# if defined(_MSC_VER)
301# define MI_FORCE_INLINE __forceinline
302# elif defined(__GNUC__)
307# define MI_FORCE_INLINE inline
309# define MI_FORCE_INLINE __attribute__ ((always_inline)) inline
312# define MI_FORCE_INLINE inline
317#define MI_HOST_DEVICE_INLINE __host__ __device__ __forceinline__
318#ifndef MI_DEVICE_INLINE
319#define MI_DEVICE_INLINE __device__ __forceinline__
323#define MI_HOST_DEVICE_INLINE MI_FORCE_INLINE
324#ifndef MI_DEVICE_INLINE
325#define MI_DEVICE_INLINE MI_FORCE_INLINE
328#define MI_HOST_DEVICE_INLINE
329#ifndef MI_DEVICE_INLINE
330#define MI_DEVICE_INLINE
335#ifdef MI_PLATFORM_WINDOWS
337#define MI_BASE_DLL_FILE_EXT ".dll"
340#define MI_BASE_DLL_FILE_EXT ".so"
343#if (__cplusplus >= 201103L)
345#define MI_CXX_FEATURE_RVALUE_REFERENCES