FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
FEAT::Util::ScopedNvtxRange Class Reference

RAII scope guard for an NVTX profiling range. More...

#include <cuda_util.hpp>

Public Member Functions

 ScopedNvtxRange (const char *name)
 opens a range name on the calling thread's default stack More...
 
 ScopedNvtxRange (const ScopedNvtxRange &)=delete
 scope guards must not be copied or moved
 
 ScopedNvtxRange (NvtxRangeStack &stack, const char *name)
 opens a range name on the given stack More...
 
 ~ScopedNvtxRange ()
 closes the range More...
 
ScopedNvtxRange & operator= (const ScopedNvtxRange &)=delete
 

Private Attributes

NvtxRangeStack & _stack
 the stack this range was pushed onto More...
 

Detailed Description

RAII scope guard for an NVTX profiling range.

Built on top of NvtxRangeStack: opens a range on construction and closes it on destruction, so wrapping a scope in a range is a single line. Uses the calling thread's default stack unless an explicit stack is supplied.

All operations are no-ops unless FEAT_HAVE_CUDA is defined.

Author
Maximilian Esser

Definition at line 251 of file cuda_util.hpp.

Constructor & Destructor Documentation

◆ ScopedNvtxRange() [1/2]

FEAT::Util::ScopedNvtxRange::ScopedNvtxRange ( const char *  name)
inlineexplicit

opens a range name on the calling thread's default stack

Definition at line 259 of file cuda_util.hpp.

References _stack, and FEAT::Util::NvtxRangeStack::push().

◆ ScopedNvtxRange() [2/2]

FEAT::Util::ScopedNvtxRange::ScopedNvtxRange ( NvtxRangeStack &  stack,
const char *  name 
)
inline

opens a range name on the given stack

Definition at line 266 of file cuda_util.hpp.

References _stack, and FEAT::Util::NvtxRangeStack::push().

◆ ~ScopedNvtxRange()

FEAT::Util::ScopedNvtxRange::~ScopedNvtxRange ( )
inline

closes the range

Definition at line 277 of file cuda_util.hpp.

References _stack, and FEAT::Util::NvtxRangeStack::pop().

Member Data Documentation

◆ _stack

NvtxRangeStack& FEAT::Util::ScopedNvtxRange::_stack
private

the stack this range was pushed onto

Definition at line 255 of file cuda_util.hpp.

Referenced by ScopedNvtxRange(), and ~ScopedNvtxRange().


The documentation for this class was generated from the following file: