Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #include "PerfGuard.h" 11 : #include "PerfGraph.h" 12 : #ifdef LIBMESH_HAVE_NVTX_API 13 : #include "nvtx3/nvtx3.hpp" 14 : #endif 15 : 16 85842674 : PerfGuard::PerfGuard(PerfGraph & graph, const PerfID id) : _graph(graph) 17 : { 18 85842674 : _graph.push(id); 19 : #ifdef LIBMESH_HAVE_NVTX_API 20 1628600 : nvtxRangePushA(moose::internal::getPerfGraphRegistry().sectionInfo(id)._name.c_str()); 21 : #endif 22 85842674 : } 23 : 24 85828289 : PerfGuard::~PerfGuard() 25 : { 26 85828289 : _graph.pop(); 27 : #ifdef LIBMESH_HAVE_NVTX_API 28 1628600 : nvtxRangePop(); 29 : #endif 30 85828289 : }