NVTX C API Reference v3
NVIDIA Tools Extension Library
Loading...
Searching...
No Matches
Domains
NVTX_DECLSPEC nvtxDomainHandle_t NVTX_API nvtxDomainCreateA (const char *name)
 Register a NVTX domain.
 
NVTX_DECLSPEC nvtxDomainHandle_t NVTX_API nvtxDomainCreateW (const wchar_t *name)
 
NVTX_DECLSPEC void NVTX_API nvtxDomainDestroy (nvtxDomainHandle_t domain)
 Unregister a NVTX domain.
 

Detailed Description

Domains are used to group events to a developer defined scope. Middleware vendors may also scope their own events to avoid collisions with the the application developer's events, so that the application developer may inspect both parts and easily differentiate or filter them. By default all events are scoped to a global domain where NULL is provided or when using APIs provided b versions of NVTX below v2

Domains are intended to be typically long lived objects with the intention of logically separating events of large modules from each other such as middleware libraries from each other and the main application.

See Domains for more details

Function Documentation

◆ nvtxDomainCreateA()

NVTX_DECLSPEC nvtxDomainHandle_t NVTX_API nvtxDomainCreateA ( const char *  name)

Register a NVTX domain.

Domains are used to scope annotations. All NVTX_VERSION_0 and NVTX_VERSION_1 annotations are scoped to the global domain. The function nvtxDomainCreate creates a new named domain.

Each domain maintains its own nvtxRangePush and nvtxRangePop stack.

Parameters
name- A unique string representing the domain.
Returns
A handle representing the domain.
Example:
nvtxDomainHandle_t domain = nvtxDomainCreateA("com.nvidia.nvtx.example");
nvtxMarkA("nvtxMarkA to global domain");
nvtxEventAttributes_t eventAttrib1 = {0};
eventAttrib1.version = NVTX_VERSION;
eventAttrib1.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
eventAttrib1.message.ascii = "nvtxDomainMarkEx to global domain";
nvtxDomainMarkEx(NULL, &eventAttrib1);
nvtxEventAttributes_t eventAttrib2 = {0};
eventAttrib2.version = NVTX_VERSION;
eventAttrib2.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
eventAttrib2.message.ascii = "nvtxDomainMarkEx to com.nvidia.nvtx.example";
nvtxDomainMarkEx(domain, &eventAttrib2);
NVTX_DECLSPEC nvtxDomainHandle_t NVTX_API nvtxDomainCreateA(const char *name)
Register a NVTX domain.
NVTX_DECLSPEC void NVTX_API nvtxDomainDestroy(nvtxDomainHandle_t domain)
Unregister a NVTX domain.
NVTX_DECLSPEC void NVTX_API nvtxDomainMarkEx(nvtxDomainHandle_t domain, const nvtxEventAttributes_t *eventAttrib)
Marks an instantaneous event in the application.
NVTX_DECLSPEC void NVTX_API nvtxMarkA(const char *message)
Marks an instantaneous event in the application.
#define NVTX_VERSION
Definition nvToolsExt.h:167
#define NVTX_EVENT_ATTRIB_STRUCT_SIZE
Definition nvToolsExt.h:247
See also
nvtxDomainDestroy
Version
\NVTX_VERSION_2

◆ nvtxDomainDestroy()

NVTX_DECLSPEC void NVTX_API nvtxDomainDestroy ( nvtxDomainHandle_t  domain)

Unregister a NVTX domain.

Unregisters the domain handle and frees all domain specific resources.

Parameters
domain- the domain handle
Example:
nvtxDomainHandle_t domain = nvtxDomainCreateA("com.nvidia.nvtx.example");
// ...
See also
nvtxDomainCreateA nvtxDomainCreateW
Version
\NVTX_VERSION_2