149 #if defined(NVTX_VERSION) && NVTX_VERSION < 3 150 #error "Trying to #include NVTX version 3 in a source file where an older NVTX version has already been included. If you are not directly using NVTX (the NVIDIA Tools Extension library), you are getting this error because libraries you are using have included different versions of NVTX. Suggested solutions are: (1) reorder #includes so the newest NVTX version is included first, (2) avoid using the conflicting libraries in the same .c/.cpp file, or (3) update the library using the older NVTX version to use the newer version instead." 154 #if !defined(NVTX_VERSION) 155 #define NVTX_VERSION 3 157 #if defined(_MSC_VER) 158 #define NVTX_API __stdcall 159 #define NVTX_INLINE_STATIC __inline static 162 #define NVTX_INLINE_STATIC inline static 165 #if defined(NVTX_NO_IMPL) 168 #define NVTX_DECLSPEC 169 #elif defined(NVTX_EXPORT_API) 172 #if !defined(NVTX_DECLSPEC) 173 #define NVTX_DECLSPEC 178 #define NVTX_DECLSPEC NVTX_INLINE_STATIC 181 #include "nvtxDetail/nvtxLinkOnce.h" 183 #define NVTX_VERSIONED_IDENTIFIER_L3(NAME, VERSION) NAME##_v##VERSION 184 #define NVTX_VERSIONED_IDENTIFIER_L2(NAME, VERSION) NVTX_VERSIONED_IDENTIFIER_L3(NAME, VERSION) 185 #define NVTX_VERSIONED_IDENTIFIER(NAME) NVTX_VERSIONED_IDENTIFIER_L2(NAME, NVTX_VERSION) 205 #ifndef NVTX_STDINT_TYPES_ALREADY_DEFINED 219 #define NVTX_SUCCESS 0 221 #define NVTX_ERR_INIT_LOAD_PROPERTY 2 222 #define NVTX_ERR_INIT_ACCESS_LIBRARY 3 223 #define NVTX_ERR_INIT_LOAD_LIBRARY 4 224 #define NVTX_ERR_INIT_MISSING_LIBRARY_ENTRY_POINT 5 225 #define NVTX_ERR_INIT_FAILED_LIBRARY_ENTRY_POINT 6 226 #define NVTX_ERR_NO_INJECTION_LIBRARY_AVAILABLE 7 231 #define NVTX_EVENT_ATTRIB_STRUCT_SIZE ( (uint16_t)( sizeof(nvtxEventAttributes_t) ) ) 233 #define NVTX_NO_PUSH_POP_TRACKING ((int)-2) 235 typedef uint64_t nvtxRangeId_t;
238 struct nvtxDomainRegistration_st;
239 typedef struct nvtxDomainRegistration_st nvtxDomainRegistration;
249 typedef nvtxDomainRegistration* nvtxDomainHandle_t;
252 struct nvtxStringRegistration_st;
253 typedef struct nvtxStringRegistration_st nvtxStringRegistration;
263 typedef nvtxStringRegistration* nvtxStringHandle_t;
296 const wchar_t* unicode;
298 nvtxStringHandle_t registered;
554 NVTX_DECLSPEC
void NVTX_API
nvtxDomainMarkEx(nvtxDomainHandle_t domain,
const nvtxEventAttributes_t* eventAttrib);
590 NVTX_DECLSPEC
void NVTX_API
nvtxMarkEx(
const nvtxEventAttributes_t* eventAttrib);
614 NVTX_DECLSPEC
void NVTX_API nvtxMarkW(
const wchar_t*
message);
649 NVTX_DECLSPEC nvtxRangeId_t NVTX_API
nvtxDomainRangeStartEx(nvtxDomainHandle_t domain,
const nvtxEventAttributes_t* eventAttrib);
683 NVTX_DECLSPEC nvtxRangeId_t NVTX_API
nvtxRangeStartEx(
const nvtxEventAttributes_t* eventAttrib);
711 NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxRangeStartW(
const wchar_t*
message);
741 NVTX_DECLSPEC
void NVTX_API
nvtxDomainRangeEnd(nvtxDomainHandle_t domain, nvtxRangeId_t
id);
757 NVTX_DECLSPEC
void NVTX_API
nvtxRangeEnd(nvtxRangeId_t
id);
798 NVTX_DECLSPEC
int NVTX_API
nvtxDomainRangePushEx(nvtxDomainHandle_t domain,
const nvtxEventAttributes_t* eventAttrib);
836 NVTX_DECLSPEC
int NVTX_API
nvtxRangePushEx(
const nvtxEventAttributes_t* eventAttrib);
862 NVTX_DECLSPEC
int NVTX_API nvtxRangePushW(
const wchar_t*
message);
937 #define NVTX_RESOURCE_MAKE_TYPE(CLASS, INDEX) ((((uint32_t)(NVTX_RESOURCE_CLASS_ ## CLASS))<<16)|((uint32_t)(INDEX))) 938 #define NVTX_RESOURCE_CLASS_GENERIC 1 951 NVTX_RESOURCE_TYPE_UNKNOWN = 0,
1099 #define NVTX_RESOURCE_ATTRIB_STRUCT_SIZE ( (uint16_t)( sizeof(nvtxResourceAttributes_v0) ) ) 1100 typedef struct nvtxResourceHandle* nvtxResourceHandle_t;
1135 NVTX_DECLSPEC nvtxResourceHandle_t NVTX_API
nvtxDomainResourceCreate(nvtxDomainHandle_t domain, nvtxResourceAttributes_t* attribs);
1198 NVTX_DECLSPEC
void NVTX_API
nvtxDomainNameCategoryA(nvtxDomainHandle_t domain, uint32_t category,
const char* name);
1199 NVTX_DECLSPEC
void NVTX_API nvtxDomainNameCategoryW(nvtxDomainHandle_t domain, uint32_t category,
const wchar_t* name);
1223 NVTX_DECLSPEC
void NVTX_API
nvtxNameCategoryA(uint32_t category,
const char* name);
1224 NVTX_DECLSPEC
void NVTX_API nvtxNameCategoryW(uint32_t category,
const wchar_t* name);
1290 NVTX_DECLSPEC
void NVTX_API
nvtxNameOsThreadA(uint32_t threadId,
const char* name);
1291 NVTX_DECLSPEC
void NVTX_API nvtxNameOsThreadW(uint32_t threadId,
const wchar_t* name);
1340 NVTX_DECLSPEC nvtxStringHandle_t NVTX_API nvtxDomainRegisterStringW(nvtxDomainHandle_t domain,
const wchar_t*
string);
1402 NVTX_DECLSPEC nvtxDomainHandle_t NVTX_API nvtxDomainCreateW(
const wchar_t* name);
1433 #define nvtxMark nvtxMarkW 1434 #define nvtxRangeStart nvtxRangeStartW 1435 #define nvtxRangePush nvtxRangePushW 1436 #define nvtxNameCategory nvtxNameCategoryW 1437 #define nvtxNameOsThread nvtxNameOsThreadW 1439 #define nvtxDomainCreate nvtxDomainCreateW 1440 #define nvtxDomainRegisterString nvtxDomainRegisterStringW 1441 #define nvtxDomainNameCategory nvtxDomainNameCategoryW 1443 #define nvtxMark nvtxMarkA 1444 #define nvtxRangeStart nvtxRangeStartA 1445 #define nvtxRangePush nvtxRangePushA 1446 #define nvtxNameCategory nvtxNameCategoryA 1447 #define nvtxNameOsThread nvtxNameOsThreadA 1449 #define nvtxDomainCreate nvtxDomainCreateA 1450 #define nvtxDomainRegisterString nvtxDomainRegisterStringA 1451 #define nvtxDomainNameCategory nvtxDomainNameCategoryA 1460 #define NVTX_IMPL_GUARD 1462 #include "nvtxDetail/nvtxTypes.h" 1464 #ifndef NVTX_NO_IMPL 1465 #include "nvtxDetail/nvtxImpl.h" 1468 #undef NVTX_IMPL_GUARD uint32_t category
ID of the category the event is assigned to.
uint16_t size
Size of the structure.
int32_t identifierType
Identifier type specifies how to interpret the identifier field.
NVTX_DECLSPEC void NVTX_API nvtxDomainMarkEx(nvtxDomainHandle_t domain, const nvtxEventAttributes_t *eventAttrib)
Marks an instantaneous event in the application.
int32_t messageType
Message type specified in this attribute structure.
NVTX_DECLSPEC void NVTX_API nvtxMarkEx(const nvtxEventAttributes_t *eventAttrib)
Marks an instantaneous event in the application.
NVTX_DECLSPEC int NVTX_API nvtxDomainRangePop(nvtxDomainHandle_t domain)
Ends a nested thread range.
NVTX_DECLSPEC nvtxResourceHandle_t NVTX_API nvtxDomainResourceCreate(nvtxDomainHandle_t domain, nvtxResourceAttributes_t *attribs)
Create a resource object to track and associate data with OS and middleware objects.
uint16_t size
Size of the structure.
NVTX_DECLSPEC void NVTX_API nvtxDomainRangeEnd(nvtxDomainHandle_t domain, nvtxRangeId_t id)
Ends a process range.
NVTX_DECLSPEC nvtxStringHandle_t NVTX_API nvtxDomainRegisterStringA(nvtxDomainHandle_t domain, const char *string)
Register a string.
NVTX_DECLSPEC void NVTX_API nvtxDomainResourceDestroy(nvtxResourceHandle_t resource)
Destroy a resource object to track and associate data with OS and middleware objects.
NVTX_DECLSPEC int NVTX_API nvtxRangePop(void)
Ends a nested thread range.
nvtxResourceGenericType_t
Generic resource type for when a resource class is not available.
NVTX_DECLSPEC int NVTX_API nvtxDomainRangePushEx(nvtxDomainHandle_t domain, const nvtxEventAttributes_t *eventAttrib)
Starts a nested thread range.
NVTX_DECLSPEC nvtxDomainHandle_t NVTX_API nvtxDomainCreateA(const char *name)
Register a NVTX domain.
int32_t messageType
Message type specified in this attribute structure.
NVTX_DECLSPEC void NVTX_API nvtxMarkA(const char *message)
Marks an instantaneous event in the application.
Payload assigned to this event.
uint16_t version
Version flag of the structure.
uint32_t color
Color assigned to this event.
Identifier for the resource.
int32_t payloadType
Payload type specified in this attribute structure.
uint16_t version
Version flag of the structure.
NVTX_DECLSPEC void NVTX_API nvtxDomainNameCategoryA(nvtxDomainHandle_t domain, uint32_t category, const char *name)
Annotate an NVTX category used within a domain.
NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxRangeStartA(const char *message)
Starts a process range.
Resource Attribute Structure.
NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxRangeStartEx(const nvtxEventAttributes_t *eventAttrib)
Starts a process range.
NVTX_DECLSPEC int NVTX_API nvtxRangePushEx(const nvtxEventAttributes_t *eventAttrib)
Starts a nested thread range.
int32_t colorType
Color type specified in this attribute structure.
NVTX_DECLSPEC void NVTX_API nvtxNameCategoryA(uint32_t category, const char *name)
Annotate an NVTX category.
NVTX_DECLSPEC void NVTX_API nvtxRangeEnd(nvtxRangeId_t id)
Ends a process range.
Event Attribute Structure.
nvtxMessageValue_t message
Message assigned to this attribute structure.
NVTX_DECLSPEC void NVTX_API nvtxNameOsThreadA(uint32_t threadId, const char *name)
Annotate an OS thread.
NVTX_DECLSPEC int NVTX_API nvtxRangePushA(const char *message)
Starts a nested thread range.
NVTX_DECLSPEC void NVTX_API nvtxDomainDestroy(nvtxDomainHandle_t domain)
Unregister a NVTX domain.
nvtxMessageValue_t message
Message assigned to this attribute structure.
NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxDomainRangeStartEx(nvtxDomainHandle_t domain, const nvtxEventAttributes_t *eventAttrib)
Starts a process range in a domain.