Skip to content

Simple header to make the use of nvtx simpler (for profiling in Nsight Systems)

Notifications You must be signed in to change notification settings

rbourgeois33/mynvtx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

README for mynvtx.h

Overview

mynvtx.h is a convenience header that simplifies the process of pushing and popping NVTX ranges with custom colors, for profiling in Nvidia Nsight system.

It provides two functions, mynvtxRangePushand mynvtxRangePop which corresponds to nvtx's nvtxRangePush and nvtxRangePop with a less verbose, easier to use color argument as well as cross-backend compilation compatibility.

An example of use of this header to monitor Kokkos functions can be found there: https://gitlab.com/rbourgeois1/some_timings_kokkos

Usage Example

#include "mynvtx.h"
void myFunction() {
    // Push a red-colored range with the message "myOperation"
    // Default color is black
    mynvtxRangePush("my region name", "red");
    
    // ... your code here ...
    
    // Pop the range after your code segment completes
    mynvtxRangePop();
}

The input can be both const char * or std::string:

#include "mynvtx.h"
void myFunction() {
    std::string some_name=name_generator(...)
    std::string some_color=color_generator(...)
    mynvtxRangePush(some_name, some_color);
    
    // ... your code here ...
    
    // Pop the range after your code segment completes
    mynvtxRangePop();
}

Portability

If no cuda compiler is detected, the provided function will do nothing. This allows compilation on non-cuda backend

About

Simple header to make the use of nvtx simpler (for profiling in Nsight Systems)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages