NVTX C++ API Reference 1.0
C++ convenience wrappers for NVTX v3 C API
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
nvtx3::v1::unique_range_in< D > Class Template Reference

A RAII object for creating a NVTX range within a domain that can be created and destroyed on different threads. More...

#include <nvtx3.hpp>

Public Member Functions

 unique_range_in (event_attributes const &attr) noexcept
 Construct a new unique_range_in object with the specified event attributes.
 
template<typename... Args>
 unique_range_in (Args const &... args) noexcept
 Constructs a unique_range_in from the constructor arguments of an event_attributes.
 
constexpr unique_range_in () noexcept
 Default constructor creates a unique_range_in with no message, color, payload, nor category.
 
 ~unique_range_in () noexcept=default
 Destroy the unique_range_in ending the range.
 
 unique_range_in (unique_range_in &&other) noexcept=default
 Move constructor allows taking ownership of the NVTX range from another unique_range_in.
 
unique_range_inoperator= (unique_range_in &&other) noexcept=default
 Move assignment operator allows taking ownership of an NVTX range from another unique_range_in.
 
 unique_range_in (unique_range_in const &)=delete
 
unique_range_inoperator= (unique_range_in const &)=delete
 

Detailed Description

template<typename D = domain::global>
class nvtx3::v1::unique_range_in< D >

A RAII object for creating a NVTX range within a domain that can be created and destroyed on different threads.

When constructed, begins a NVTX range in the specified domain. Upon destruction, ends the NVTX range.

Similar to nvtx3::scoped_range_in, with a few key differences:

There is extra overhead associated with unique_range constructs and therefore use of nvtx3::scoped_range_in should be preferred.

Template Parameters
DType containing name member used to identify the domain to which the unique_range_in belongs. Else, domain::global to indicate that the global NVTX domain should be used.

Definition at line 2523 of file nvtx3.hpp.

Constructor & Destructor Documentation

◆ unique_range_in() [1/5]

template<typename D = domain::global>
nvtx3::v1::unique_range_in< D >::unique_range_in ( event_attributes const &  attr)
inlineexplicitnoexcept

Construct a new unique_range_in object with the specified event attributes.

Example:

nvtx3::event_attributes attr{"msg", nvtx3::rgb{127,255,0}};
nvtx3::unique_range_in<my_domain> range{attr}; // Creates a range with message contents
// "msg" and green color
Describes the attributes of a NVTX event.
Definition nvtx3.hpp:1941
A RAII object for creating a NVTX range within a domain that can be created and destroyed on differen...
Definition nvtx3.hpp:2523
Indicates the values of the red, green, and blue color channels for an RGB color to use as an event a...
Definition nvtx3.hpp:980
Parameters
[in]attrevent_attributes that describes the desired attributes of the range.

Definition at line 2538 of file nvtx3.hpp.

◆ unique_range_in() [2/5]

template<typename D = domain::global>
template<typename... Args>
nvtx3::v1::unique_range_in< D >::unique_range_in ( Args const &...  args)
inlineexplicitnoexcept

Constructs a unique_range_in from the constructor arguments of an event_attributes.

Forwards the arguments args... to construct an event_attributes object. The event_attributes object is then associated with the unique_range_in.

For more detail, see event_attributes documentation.

Example:

// Creates a range with message "message" and green color
nvtx3::unique_range_in<> r{"message", nvtx3::rgb{127,255,0}};
Parameters
[in]argsVariadic parameter pack of arguments to construct an event_attributes associated with this range.

Definition at line 2563 of file nvtx3.hpp.

◆ unique_range_in() [3/5]

template<typename D = domain::global>
constexpr nvtx3::v1::unique_range_in< D >::unique_range_in ( )
inlineconstexprnoexcept

Default constructor creates a unique_range_in with no message, color, payload, nor category.

Definition at line 2573 of file nvtx3.hpp.

◆ unique_range_in() [4/5]

template<typename D = domain::global>
nvtx3::v1::unique_range_in< D >::unique_range_in ( unique_range_in< D > &&  other)
defaultnoexcept

Move constructor allows taking ownership of the NVTX range from another unique_range_in.

Parameters
otherThe range to take ownership of

◆ unique_range_in() [5/5]

template<typename D = domain::global>
nvtx3::v1::unique_range_in< D >::unique_range_in ( unique_range_in< D > const &  )
delete

Copy construction is not allowed to prevent multiple objects from owning the same range handle

Member Function Documentation

◆ operator=() [1/2]

template<typename D = domain::global>
unique_range_in & nvtx3::v1::unique_range_in< D >::operator= ( unique_range_in< D > &&  other)
defaultnoexcept

Move assignment operator allows taking ownership of an NVTX range from another unique_range_in.

Parameters
otherThe range to take ownership of

◆ operator=() [2/2]

template<typename D = domain::global>
unique_range_in & nvtx3::v1::unique_range_in< D >::operator= ( unique_range_in< D > const &  )
delete

Copy assignment is not allowed to prevent multiple objects from owning the same range handle


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