Hedgehog
3.1.0
A library to generate hybrid pipeline workflow systems
|
A class to wrap calls to the NVTX library for tracking events that occur within an Hedgehog task graph. More...
#include "nvtx_profiler.h"
Public Member Functions | |
NvtxProfiler ()=delete | |
Deleted default constructor. | |
NvtxProfiler (std::string const &taskName) | |
Constructs the NvtxProfiler with the name of the task. | |
~NvtxProfiler () | |
Destructor, deletes all attributes allocated. | |
void | initialize (int threadId) |
Initializes the NvtxProfiler, and adds the threadId that is associated with the task. | |
void | addReleaseMarker () |
Adds hedgehog release marker into the timeline to show when the task released memory. | |
void | startRangeInitializing () |
Starts tracking intialization in the timeline to show when the task has started its initialization phase. | |
void | startRangeExecuting () |
Starts tracking execution in the timeline to show when the task has started executing on data. | |
void | startRangeWaiting (size_t const &queueSize) |
Starts tracking execution in the timeline to show when the task has started waiting for data. | |
void | startRangeWaitingForMemory () |
Starts tracking waiting for memory in the timeline to show when the task has started waiting for memory from hedgehog memory manager. | |
void | startRangeShuttingDown () |
Starts tracking shutdown in the timeline to show when the task has started its shutdown phase. | |
void | endRangeInitializing () |
Ends tracking the initialization phase for hedgehog task. | |
void | endRangeExecuting () |
Ends tracking the execute for hedgehog task. | |
void | endRangeWaiting () |
Ends tracking the waiting for data for hedgehog task. | |
void | endRangeWaitingForMem () |
Ends tracking the waiting for memory from hedgehog memory edge. | |
void | endRangeShuttingDown () |
Ends tracking the shutdown phase for hedgehog task. | |
Static Private Member Functions | |
static nvtxEventAttributes_t * | createEventAttribute (uint32_t color) |
Creates an event attribute with hedgehog specified color. | |
Private Attributes | |
std::string | initializeName_ {} |
Name for the initialization attribute. | |
std::string | executeName_ {} |
Name for the execute attribute. | |
std::string | waitName_ {} |
Name for the wait attribute. | |
std::string | waitForMemName_ {} |
Name for the wait for memory attribute. | |
std::string | releaseMemName_ {} |
Name for the release memory attribute. | |
std::string | shutdownName_ {} |
Name for the shutdown attribute. | |
nvtxDomainHandle_t | taskDomain_ |
The domain for the task. | |
nvtxStringHandle_t | initializeString_ {} |
Cache'd string used within the initialize attribute. | |
nvtxStringHandle_t | executeString_ {} |
Cache'd string used within the execute attribute. | |
nvtxStringHandle_t | waitString_ {} |
Cache'd string used within the wait attribute. | |
nvtxStringHandle_t | waitForMemString_ {} |
Cache'd string used within the wait for memory attribute. | |
nvtxStringHandle_t | releaseMemString_ {} |
Cache'd string used within the release memory attribute. | |
nvtxStringHandle_t | shutdownString_ {} |
Cache'd string used within the shutdown attribute. | |
nvtxEventAttributes_t * | initializeAttrib_ |
The initialize attribute. | |
nvtxEventAttributes_t * | executeAttrib_ |
The execute attribute. | |
nvtxEventAttributes_t * | waitAttrib_ |
The wait attribute. | |
nvtxEventAttributes_t * | waitForMemAttrib_ |
The wait for memory attribute. | |
nvtxEventAttributes_t * | releaseMemAttrib_ |
The release memory attribute. | |
nvtxEventAttributes_t * | shutdownAttrib_ |
The shutdown attribute. | |
nvtxRangeId_t | initializeRangeId_ = 0 |
Range identifier for initialize. | |
nvtxRangeId_t | executeRangeId_ = 0 |
Range identifier for execute. | |
nvtxRangeId_t | waitRangeId_ = 0 |
Range identifier for wait (for data) | |
nvtxRangeId_t | waitForMemRangeId_ = 0 |
Range identifier for wait for memory. | |
nvtxRangeId_t | shutdownRangeId_ = 0 |
Range identifier for shutdown. | |
A class to wrap calls to the NVTX library for tracking events that occur within an Hedgehog task graph.
Hedgehog uses the NVTX API and NVIDIA Nsight Systems to visualize the execution of hedgehog graph of tasks.
The current profiling mode is to have one NVTX domain per task.
In this mode, hedgehog task uses the single domain to visualize when the task is initializing, executing, waiting for memory, waiting for data, releasing memory, and shutting down. This has the effect of visualizing all tasks and their threads to identify precisely what that task is doing at any moment in time. This is useful for visualizing the interaction between tasks and identify bottlenecks.
Depending on the version of the Nsight Systems tool, there may be limitations to the number of NVTX domains. If your graph is extremely large, it is recommended to get the latest version of the NVIDIA Nsight Systems tool.
Definition at line 58 of file nvtx_profiler.h.
|
delete |
Deleted default constructor.
|
inlineexplicit |
Constructs the NvtxProfiler with the name of the task.
Each NvtxProfiler will hold profiling information for each task. It will profile all stages of the task's life cycle: initialize, execution, waiting for data, waiting for memory, releasing memory, and shutting down.
taskName | the name of the task |
Definition at line 101 of file nvtx_profiler.h.
|
inline |
Destructor, deletes all attributes allocated.
Definition at line 124 of file nvtx_profiler.h.
|
inline |
Adds hedgehog release marker into the timeline to show when the task released memory.
Definition at line 179 of file nvtx_profiler.h.
|
inlinestaticprivate |
Creates an event attribute with hedgehog specified color.
color | the color shown in the timeline view |
Definition at line 263 of file nvtx_profiler.h.
|
inline |
Ends tracking the execute for hedgehog task.
Definition at line 232 of file nvtx_profiler.h.
|
inline |
Ends tracking the initialization phase for hedgehog task.
Definition at line 225 of file nvtx_profiler.h.
|
inline |
Ends tracking the shutdown phase for hedgehog task.
Definition at line 253 of file nvtx_profiler.h.
|
inline |
Ends tracking the waiting for data for hedgehog task.
Definition at line 239 of file nvtx_profiler.h.
|
inline |
Ends tracking the waiting for memory from hedgehog memory edge.
Definition at line 246 of file nvtx_profiler.h.
|
inline |
Initializes the NvtxProfiler, and adds the threadId that is associated with the task.
Initialization of the NvtxProfiler creates and cache's the string names of the various event attributes
threadId | the thread identifier |
Definition at line 141 of file nvtx_profiler.h.
|
inline |
Starts tracking execution in the timeline to show when the task has started executing on data.
Definition at line 193 of file nvtx_profiler.h.
|
inline |
Starts tracking intialization in the timeline to show when the task has started its initialization phase.
Definition at line 186 of file nvtx_profiler.h.
|
inline |
Starts tracking shutdown in the timeline to show when the task has started its shutdown phase.
Definition at line 218 of file nvtx_profiler.h.
|
inline |
Starts tracking execution in the timeline to show when the task has started waiting for data.
This event shows the current queue size in the payload within the attribute.
queueSize | the queue size |
Definition at line 202 of file nvtx_profiler.h.
|
inline |
Starts tracking waiting for memory in the timeline to show when the task has started waiting for memory from hedgehog memory manager.
Definition at line 211 of file nvtx_profiler.h.
|
private |
The execute attribute.
Definition at line 78 of file nvtx_profiler.h.
|
private |
Name for the execute attribute.
Definition at line 62 of file nvtx_profiler.h.
|
private |
Range identifier for execute.
Definition at line 85 of file nvtx_profiler.h.
|
private |
Cache'd string used within the execute attribute.
Definition at line 71 of file nvtx_profiler.h.
|
private |
The initialize attribute.
Definition at line 77 of file nvtx_profiler.h.
|
private |
Name for the initialization attribute.
Definition at line 61 of file nvtx_profiler.h.
|
private |
Range identifier for initialize.
Definition at line 84 of file nvtx_profiler.h.
|
private |
Cache'd string used within the initialize attribute.
Definition at line 70 of file nvtx_profiler.h.
|
private |
The release memory attribute.
Definition at line 81 of file nvtx_profiler.h.
|
private |
Name for the release memory attribute.
Definition at line 65 of file nvtx_profiler.h.
|
private |
Cache'd string used within the release memory attribute.
Definition at line 74 of file nvtx_profiler.h.
|
private |
The shutdown attribute.
Definition at line 82 of file nvtx_profiler.h.
|
private |
Name for the shutdown attribute.
Definition at line 66 of file nvtx_profiler.h.
|
private |
Range identifier for shutdown.
Definition at line 88 of file nvtx_profiler.h.
|
private |
Cache'd string used within the shutdown attribute.
Definition at line 75 of file nvtx_profiler.h.
|
private |
The domain for the task.
Definition at line 68 of file nvtx_profiler.h.
|
private |
The wait attribute.
Definition at line 79 of file nvtx_profiler.h.
|
private |
The wait for memory attribute.
Definition at line 80 of file nvtx_profiler.h.
|
private |
Name for the wait for memory attribute.
Definition at line 64 of file nvtx_profiler.h.
|
private |
Range identifier for wait for memory.
Definition at line 87 of file nvtx_profiler.h.
|
private |
Cache'd string used within the wait for memory attribute.
Definition at line 73 of file nvtx_profiler.h.
|
private |
Name for the wait attribute.
Definition at line 63 of file nvtx_profiler.h.
|
private |
Range identifier for wait (for data)
Definition at line 86 of file nvtx_profiler.h.
|
private |
Cache'd string used within the wait attribute.
Definition at line 72 of file nvtx_profiler.h.