20 #include <nvtx3/nvToolsExt.h>
22 #include <nvtx3/nvToolsExtCuda.h>
33 namespace nvtx_helpers {
85 inline void name_cuda_device(
CUdevice device,
const char*
name) {
86 nvtxNameCuDeviceA(device, name);
88 inline void name_cuda_context(
CUcontext context,
const char*
name) {
89 nvtxNameCuContextA(context, name);
91 inline void name_cuda_stream(
CUstream stream,
const char*
name) {
92 nvtxNameCuStreamA(stream, name);
94 inline void name_cuda_event(CUevent event,
const char*
name) {
95 nvtxNameCuEventA(event, name);
102 nvtxNameCategory(category, name);
108 nvtxDomainNameCategoryA(domain, category, name);
116 inline nvtxEventAttributes_t make_event_attrib(
const char*
name, uint32_t color) {
117 nvtxEventAttributes_t event_attrib = {};
118 event_attrib.version = NVTX_VERSION;
119 event_attrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
121 event_attrib.colorType = NVTX_COLOR_ARGB;
122 event_attrib.color = color;
124 event_attrib.messageType = NVTX_MESSAGE_TYPE_ASCII;
125 event_attrib.message.ascii =
name;
134 inline void set_mark(
const char* message) {
140 nvtxRangePushA(name);
144 inline void range_push(
const char* name,
const uint32_t category,
const uint32_t color) {
145 auto event_attrib = make_event_attrib(name, color);
146 nvtxRangePushEx(&event_attrib);
156 return nvtxRangeStartA(name);
161 const uint32_t category,
162 const uint32_t color) {
163 auto event_attrib = make_event_attrib(name, color);
164 return nvtxRangeStartEx(&event_attrib);
178 return nvtxDomainCreateA(name);
183 nvtxDomainDestroy(domain);
188 auto event_attrib = make_event_attrib(name, color);
189 nvtxDomainMarkEx(domain, &event_attrib);
197 auto event_attrib = make_event_attrib(name, color);
198 event_attrib.category = category;
199 nvtxDomainRangePushEx(domain, &event_attrib);
204 nvtxDomainRangePop(domain);
210 const uint32_t category,
211 const uint32_t color) {
212 auto event_attrib = make_event_attrib(name, color);
213 return nvtxDomainRangeStartEx(domain, &event_attrib);
218 nvtxDomainRangeEnd(domain, range);
227 inline void init() {}
264 inline void name_cuda_device(
CUdevice,
const char*) {}
265 inline void name_cuda_context(
CUcontext,
const char*) {}
266 inline void name_cuda_stream(
CUstream,
const char*) {}
267 inline void name_cuda_event(CUevent,
const char*) {}
const nvtxDomainHandle_t get_omnisci_domain()
void set_mark(const char *)
void omnisci_range_end(nvtxRangeId_t r)
void name_domain_category(nvtxDomainHandle_t domain, uint32_t category, const char *name)
void name_category(uint32_t category, const char *name)
void destroy_domain(nvtxDomainHandle_t)
void omnisci_range_push(Category c, const char *name, const char *file)
void set_domain_mark(nvtxDomainHandle_t, const char *, uint32_t)
void name_current_thread(const char *name)
void domain_range_pop(nvtxDomainHandle_t)
void omnisci_set_mark(Category c, const char *name)
void domain_range_push(nvtxDomainHandle_t, const char *, uint32_t, uint32_t)
void range_push(const char *)
nvtxDomainHandle_t create_domain(const char *)
nvtxRangeId_t range_start(const char *)
void range_end(nvtxRangeId_t)
nvtxRangeId_t omnisci_range_start(Category c, const char *name)
void * nvtxDomainHandle_t