File indexing completed on 2026-05-10 08:45:12
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #ifndef NVTX_EXT_IMPL_PAYLOAD_GUARD
0022 #error Never include this file directly -- it is automatically included by nvToolsExtPayload.h (except when NVTX_NO_IMPL is defined).
0023 #endif
0024
0025 #if defined(NVTX_AS_SYSTEM_HEADER)
0026 #if defined(__clang__)
0027 #pragma clang system_header
0028 #elif defined(__GNUC__) || defined(__NVCOMPILER)
0029 #pragma GCC system_header
0030 #elif defined(_MSC_VER)
0031 #pragma system_header
0032 #endif
0033 #endif
0034
0035 typedef void* nvtx_payload_pointer_type;
0036
0037 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L)
0038 #ifndef __APPLE__
0039 #include <uchar.h>
0040 #endif
0041 #include <stdalign.h>
0042 #endif
0043
0044
0045 #if ((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || (defined(__cplusplus) && __cplusplus >= 201811L)) && !defined(__APPLE__)
0046 #define NVTX_HAVE_CHAR8 1
0047 #else
0048 #define NVTX_HAVE_CHAR8 0
0049 #endif
0050
0051
0052 #if ((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || (defined(__cplusplus) && __cplusplus >= 200704L)) && !defined(__APPLE__)
0053 #define NVTX_HAVE_CHAR16_CHAR32 1
0054 #else
0055 #define NVTX_HAVE_CHAR16_CHAR32 0
0056 #endif
0057
0058
0059 #if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || (defined(__cplusplus) && __cplusplus >= 201103L)
0060
0061 #define nvtx_alignof(type) alignof(type)
0062 #define nvtx_alignof2(type,tname) alignof(type)
0063
0064 #else
0065
0066
0067 #define MKTYPEDEF(type) typedef struct {char c; type d;} _nvtx_##type
0068 #define MKTYPEDEF2(type,tname) typedef struct {char c; type d;} _nvtx_##tname
0069
0070 MKTYPEDEF(char);
0071 MKTYPEDEF2(unsigned char, uchar);
0072 MKTYPEDEF(short);
0073 MKTYPEDEF2(unsigned short, ushort);
0074 MKTYPEDEF(int);
0075 MKTYPEDEF2(unsigned int, uint);
0076 MKTYPEDEF(long);
0077 MKTYPEDEF2(unsigned long, ulong);
0078 MKTYPEDEF2(long long, longlong);
0079 MKTYPEDEF2(unsigned long long, ulonglong);
0080
0081 MKTYPEDEF(int8_t);
0082 MKTYPEDEF(uint8_t);
0083 MKTYPEDEF(int16_t);
0084 MKTYPEDEF(uint16_t);
0085 MKTYPEDEF(int32_t);
0086 MKTYPEDEF(uint32_t);
0087 MKTYPEDEF(int64_t);
0088 MKTYPEDEF(uint64_t);
0089
0090 MKTYPEDEF(float);
0091 MKTYPEDEF(double);
0092 MKTYPEDEF2(long double, longdouble);
0093
0094 MKTYPEDEF(size_t);
0095 MKTYPEDEF(nvtx_payload_pointer_type);
0096
0097 MKTYPEDEF(wchar_t);
0098
0099 #if NVTX_HAVE_CHAR8
0100 MKTYPEDEF(char8_t);
0101 #endif
0102
0103 #if NVTX_HAVE_CHAR16_CHAR32
0104 MKTYPEDEF(char16_t);
0105 MKTYPEDEF(char32_t);
0106 #endif
0107
0108
0109 #ifndef __cplusplus
0110 #include <stddef.h>
0111 #endif
0112
0113 #define nvtx_alignof(tname) offsetof(_nvtx_##tname, d)
0114 #define nvtx_alignof2(type, tname) offsetof(_nvtx_##tname, d)
0115
0116 #endif
0117
0118 #undef MKTYPEDEF
0119 #undef MKTYPEDEF2
0120
0121
0122
0123
0124
0125
0126
0127
0128 NVTX_LINKONCE_DEFINE_GLOBAL
0129 #ifdef __cplusplus
0130 extern
0131 #endif
0132 const nvtxPayloadEntryTypeInfo_t
0133 NVTX_EXT_PAYLOAD_VERSIONED_ID(nvtxExtPayloadTypeInfo)[NVTX_PAYLOAD_ENTRY_TYPE_INFO_ARRAY_SIZE] =
0134 {
0135
0136 {NVTX_PAYLOAD_ENTRY_TYPE_INFO_ARRAY_SIZE, sizeof(nvtxPayloadEntryTypeInfo_t)},
0137
0138
0139 {sizeof(char), nvtx_alignof(char)},
0140 {sizeof(unsigned char), nvtx_alignof2(unsigned char, uchar)},
0141 {sizeof(short), nvtx_alignof(short)},
0142 {sizeof(unsigned short), nvtx_alignof2(unsigned short, ushort)},
0143 {sizeof(int), nvtx_alignof(int)},
0144 {sizeof(unsigned int), nvtx_alignof2(unsigned int, uint)},
0145 {sizeof(long), nvtx_alignof(long)},
0146 {sizeof(unsigned long), nvtx_alignof2(unsigned long, ulong)},
0147 {sizeof(long long), nvtx_alignof2(long long, longlong)},
0148 {sizeof(unsigned long long), nvtx_alignof2(unsigned long long,ulonglong)},
0149
0150
0151 {sizeof(int8_t), nvtx_alignof(int8_t)},
0152 {sizeof(uint8_t), nvtx_alignof(uint8_t)},
0153 {sizeof(int16_t), nvtx_alignof(int16_t)},
0154 {sizeof(uint16_t), nvtx_alignof(uint16_t)},
0155 {sizeof(int32_t), nvtx_alignof(int32_t)},
0156 {sizeof(uint32_t), nvtx_alignof(uint32_t)},
0157 {sizeof(int64_t), nvtx_alignof(int64_t)},
0158 {sizeof(uint64_t), nvtx_alignof(uint64_t)},
0159
0160
0161 {sizeof(float), nvtx_alignof(float)},
0162 {sizeof(double), nvtx_alignof(double)},
0163 {sizeof(long double), nvtx_alignof2(long double, longdouble)},
0164
0165 {sizeof(size_t), nvtx_alignof(size_t)},
0166 {sizeof(nvtx_payload_pointer_type), nvtx_alignof(nvtx_payload_pointer_type)},
0167
0168
0169 {sizeof(wchar_t), nvtx_alignof(wchar_t)},
0170
0171 #if NVTX_HAVE_CHAR8
0172 {sizeof(char8_t), nvtx_alignof(char8_t)},
0173 #else
0174 {0, 0},
0175 #endif
0176
0177 #if NVTX_HAVE_CHAR16_CHAR32
0178 {sizeof(char16_t), nvtx_alignof(char16_t)},
0179 {sizeof(char32_t), nvtx_alignof(char32_t)}
0180 #else
0181 {0, 0},
0182 {0, 0}
0183 #endif
0184 };
0185
0186 #undef nvtx_alignof
0187 #undef nvtx_alignof2
0188 #undef NVTX_HAVE_CHAR8
0189 #undef NVTX_HAVE_CHAR16_CHAR32