NVTX C++ API Reference 1.0
C++ convenience wrappers for NVTX v3 C API
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
nvtx3::v1::event_attributes Class Reference

Describes the attributes of a NVTX event. More...

#include <nvtx3.hpp>

Public Types

using value_type = nvtxEventAttributes_t
 

Public Member Functions

constexpr event_attributes () noexcept
 Default constructor creates an event_attributes with no category, color, payload, nor message. More...
 
template<typename... Args>
 event_attributes (category const &c, Args const &... args) noexcept
 Variadic constructor where the first argument is a category. More...
 
template<typename... Args>
 event_attributes (color const &c, Args const &... args) noexcept
 Variadic constructor where the first argument is a color. More...
 
template<typename... Args>
 event_attributes (payload const &p, Args const &... args) noexcept
 Variadic constructor where the first argument is a payload. More...
 
template<typename... Args>
 event_attributes (message const &m, Args const &... args) noexcept
 Variadic constructor where the first argument is a message. More...
 
 event_attributes (event_attributes const &)=default
 
event_attributesoperator= (event_attributes const &)=default
 
 event_attributes (event_attributes &&)=default
 
event_attributesoperator= (event_attributes &&)=default
 
constexpr value_type const * get () const noexcept
 Get raw pointer to underlying NVTX attributes object. More...
 

Detailed Description

Describes the attributes of a NVTX event.

NVTX events can be customized via four "attributes":

These component attributes are specified via an event_attributes object. See nvtx3::color, nvtx3::message, nvtx3::payload, and nvtx3::category for how these individual attributes are constructed.

While it is possible to specify all four attributes, it is common to want to only specify a subset of attributes and use default values for the others. For convenience, event_attributes can be constructed from any number of attribute components in any order.

Example:

// Set message, same as using nvtx3::message{"message"}
event_attributes attr{"message"};
// Set message and color
event_attributes attr{"message", nvtx3::rgb{127, 255, 0}};
// Set message, color, payload, category
event_attributes attr{"message",
nvtx3::rgb{127, 255, 0},
// Same as above -- can use any order of arguments
"message",
nvtx3::rgb{127, 255, 0}};
// Multiple arguments of the same type are allowed, but only the first is
// used -- in this example, payload is set to 42:
// Range `r` will be customized according the attributes in `attr`
// For convenience, `event_attributes` constructor arguments may be passed
// to the `scoped_range_in` contructor -- they are forwarded to the
// `event_attributes` constructor
// Using the nvtx3 namespace in a local scope makes the syntax more succinct:
using namespace nvtx3;
scoped_range r{payload{42}, category{1}, "message"};
Object for intra-domain grouping of NVTX events.
Definition: nvtx3.hpp:1125
Describes the attributes of a NVTX event.
Definition: nvtx3.hpp:1913
constexpr event_attributes() noexcept
Default constructor creates an event_attributes with no category, color, payload, nor message.
Definition: nvtx3.hpp:1921
A numerical value that can be associated with an NVTX event via its event_attributes.
Definition: nvtx3.hpp:1753
scoped_range_in< domain::global > scoped_range
Alias for a scoped_range_in in the global NVTX domain.
Definition: nvtx3.hpp:2146
Indicates the values of the red, green, and blue color channels for an RGB color to use as an event a...
Definition: nvtx3.hpp:952

Definition at line 1913 of file nvtx3.hpp.

Member Typedef Documentation

◆ value_type

using nvtx3::v1::event_attributes::value_type = nvtxEventAttributes_t

Definition at line 1915 of file nvtx3.hpp.

Constructor & Destructor Documentation

◆ event_attributes() [1/5]

constexpr nvtx3::v1::event_attributes::event_attributes ( )
inlineconstexprnoexcept

Default constructor creates an event_attributes with no category, color, payload, nor message.

Definition at line 1921 of file nvtx3.hpp.

◆ event_attributes() [2/5]

template<typename... Args>
nvtx3::v1::event_attributes::event_attributes ( category const &  c,
Args const &...  args 
)
inlineexplicitnoexcept

Variadic constructor where the first argument is a category.

Sets the value of the EventAttributes category based on c and forwards the remaining variadic parameter pack to the next constructor.

Definition at line 1945 of file nvtx3.hpp.

◆ event_attributes() [3/5]

template<typename... Args>
nvtx3::v1::event_attributes::event_attributes ( color const &  c,
Args const &...  args 
)
inlineexplicitnoexcept

Variadic constructor where the first argument is a color.

Sets the value of the EventAttributes color based on c and forwards the remaining variadic parameter pack to the next constructor.

Definition at line 1959 of file nvtx3.hpp.

◆ event_attributes() [4/5]

template<typename... Args>
nvtx3::v1::event_attributes::event_attributes ( payload const &  p,
Args const &...  args 
)
inlineexplicitnoexcept

Variadic constructor where the first argument is a payload.

Sets the value of the EventAttributes payload based on p and forwards the remaining variadic parameter pack to the next constructor.

Definition at line 1974 of file nvtx3.hpp.

◆ event_attributes() [5/5]

template<typename... Args>
nvtx3::v1::event_attributes::event_attributes ( message const &  m,
Args const &...  args 
)
inlineexplicitnoexcept

Variadic constructor where the first argument is a message.

Sets the value of the EventAttributes message based on m and forwards the remaining variadic parameter pack to the next constructor.

Definition at line 1989 of file nvtx3.hpp.

Member Function Documentation

◆ get()

constexpr value_type const * nvtx3::v1::event_attributes::get ( ) const
inlineconstexprnoexcept

Get raw pointer to underlying NVTX attributes object.

Definition at line 2006 of file nvtx3.hpp.


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