Tachyon (current)  Current Main Branch
Macros
ProfileHooks.h File Reference

CPU and GPU profiling utility macros/routines. More...

Go to the source code of this file.

Macros

#define PROFILE_INITIALIZE()   do { } while(0)
 Initialize the profiling system. More...
 
#define PROFILE_START()   do { } while(0)
 Trigger the beginning of profiler trace capture, for those that support it. More...
 
#define PROFILE_STOP()   do { } while(0)
 Trigger the stop of profiler trace capture, for those that support it. More...
 
#define PROFILE_MAIN_THREAD()   do { } while(0)
 Assign this as the "main" thread for the benefit of profile trace display. More...
 
#define PROFILE_NAME_THREAD(name)   do { } while(0)
 Assign a caller-provided string as the name of the current thread for use in profiler trace display. More...
 
#define PROFILE_MARK(name, cid)   do { } while(0)
 Insert an "event" into the profiler trace display, with the caller-provided string and color index. More...
 
#define PROFILE_PUSH_RANGE(name, cid)   do { } while(0)
 Pushes a time range annotation onto the profiler's trace stack, beginning at the time of submission, and ending when a matching PROFILE_POP_RANGE is encountered. More...
 
#define PROFILE_POP_RANGE()   do { } while(0)
 Pops the innermost time range off of the profiler's trace stack, at the time of execution. More...
 
#define PROFILE_RANGE(name, cid)   do { } while(0)
 Embeds event recording into a class to automatically pop when destroyed. More...
 
#define PROFILE_STREAM_SYNC_PRETTY(stream)   do { } while(0)
 Helper macro that can conditionally insert extra calls to cudaStreamSynchronize() into an application, which are not required for correctness, but are sometimes beneficial to ensure that long sequences of asynchronous API calls don't result in illegible profile traces. More...
 

Detailed Description

CPU and GPU profiling utility macros/routines.

Exemplary use of NVTX is shown here: https://devblogs.nvidia.com/cuda-pro-tip-generate-custom-application-profile-timelines-nvtx/

NVTX3 eliminates the need for linkage w/ the nvtools library: https://github.com/NVIDIA/NVTX https://nvidia.github.io/NVTX/doxygen/index.html

NVTX3 C++ RAII-based tag documentation: https://github.com/NVIDIA/NVTX/tree/dev/cpp https://jrhemstad.github.io/nvtx_wrappers/html/index.html https://jrhemstad.github.io/nvtx_wrappers/html/nvtx3_8hpp.html

Definition in file ProfileHooks.h.

Macro Definition Documentation

◆ PROFILE_INITIALIZE

#define PROFILE_INITIALIZE ( )    do { } while(0)

Initialize the profiling system.

Definition at line 250 of file ProfileHooks.h.

Referenced by main().

◆ PROFILE_MAIN_THREAD

#define PROFILE_MAIN_THREAD ( )    do { } while(0)

Assign this as the "main" thread for the benefit of profile trace display.

Definition at line 259 of file ProfileHooks.h.

◆ PROFILE_MARK

#define PROFILE_MARK (   name,
  cid 
)    do { } while(0)

Insert an "event" into the profiler trace display, with the caller-provided string and color index.

The inserted event is just a mark or timestamp, and has no defined time length associated with it.

Definition at line 269 of file ProfileHooks.h.

◆ PROFILE_NAME_THREAD

#define PROFILE_NAME_THREAD (   name)    do { } while(0)

Assign a caller-provided string as the name of the current thread for use in profiler trace display.

Definition at line 263 of file ProfileHooks.h.

◆ PROFILE_POP_RANGE

#define PROFILE_POP_RANGE ( )    do { } while(0)

Pops the innermost time range off of the profiler's trace stack, at the time of execution.

Definition at line 279 of file ProfileHooks.h.

Referenced by TachyonOptiX::framebuffer_resize(), main(), TachyonOptiX::render(), TachyonOptiX::TachyonOptiX(), and TachyonOptiX::~TachyonOptiX().

◆ PROFILE_PUSH_RANGE

#define PROFILE_PUSH_RANGE (   name,
  cid 
)    do { } while(0)

Pushes a time range annotation onto the profiler's trace stack, beginning at the time of submission, and ending when a matching PROFILE_POP_RANGE is encountered.

The new annotation is named with a caller-provided string and is colored according to the provided color index.

Definition at line 275 of file ProfileHooks.h.

Referenced by TachyonOptiX::framebuffer_resize(), main(), TachyonOptiX::render(), TachyonOptiX::TachyonOptiX(), and TachyonOptiX::~TachyonOptiX().

◆ PROFILE_RANGE

#define PROFILE_RANGE (   name,
  cid 
)    do { } while(0)

Embeds event recording into a class to automatically pop when destroyed.

Definition at line 282 of file ProfileHooks.h.

◆ PROFILE_START

#define PROFILE_START ( )    do { } while(0)

Trigger the beginning of profiler trace capture, for those that support it.

Definition at line 253 of file ProfileHooks.h.

Referenced by main().

◆ PROFILE_STOP

#define PROFILE_STOP ( )    do { } while(0)

Trigger the stop of profiler trace capture, for those that support it.

Definition at line 256 of file ProfileHooks.h.

◆ PROFILE_STREAM_SYNC_PRETTY

#define PROFILE_STREAM_SYNC_PRETTY (   stream)    do { } while(0)

Helper macro that can conditionally insert extra calls to cudaStreamSynchronize() into an application, which are not required for correctness, but are sometimes beneficial to ensure that long sequences of asynchronous API calls don't result in illegible profile traces.

Definition at line 289 of file ProfileHooks.h.

Referenced by TachyonOptiX::render().