File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3838#ifndef LIBMESH_HAVE_GETTIMEOFDAY
3939#include " libmesh/win_gettimeofday.h" // gettimeofday() on Windows
4040#endif
41+ #ifdef LIBMESH_HAVE_NVTX_API
42+ #include < nvtx3/nvtx3.hpp>
43+ #endif
4144
4245namespace libMesh
4346{
@@ -505,6 +508,14 @@ void PerfLog::fast_push (const char * label,
505508 else
506509 perf_data->start ();
507510 log_stack.push (perf_data);
511+
512+ #ifdef LIBMESH_HAVE_NVTX_API
513+ // This takes a single const char *, and we don't want to waste
514+ // time allocating a new string on every push, so for now we'll
515+ // drop the header. Maybe we should allocate a new string in
516+ // the PerfData?
517+ nvtxRangePushA (label);
518+ #endif
508519 }
509520}
510521
@@ -516,6 +527,9 @@ void PerfLog::fast_pop(const char * libmesh_dbg_var(label),
516527{
517528 if (this ->log_events )
518529 {
530+ #ifdef LIBMESH_HAVE_NVTX_API
531+ nvtxRangePop ();
532+ #endif
519533 // If there's nothing on the stack, then we can't pop anything. Previously we
520534 // asserted that the log_stack was not empty, but we should not throw from
521535 // this function, so instead just return in that case.
You can’t perform that action at this time.
0 commit comments