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::payload Class Reference

A numerical value that can be associated with an NVTX event via its event_attributes. More...

#include <nvtx3.hpp>

Public Types

using value_type = typename nvtxEventAttributes_v2::payload_t
 

Public Member Functions

 payload (int64_t value) noexcept
 Construct a payload from a signed, 8 byte integer. More...
 
 payload (int32_t value) noexcept
 Construct a payload from a signed, 4 byte integer. More...
 
 payload (uint64_t value) noexcept
 Construct a payload from an unsigned, 8 byte integer. More...
 
 payload (uint32_t value) noexcept
 Construct a payload from an unsigned, 4 byte integer. More...
 
 payload (float value) noexcept
 Construct a payload from a single-precision floating point value. More...
 
 payload (double value) noexcept
 Construct a payload from a double-precision floating point value. More...
 
constexpr payload (nvtxPayloadType_t const &type, value_type const &value) noexcept
 Construct a payload from NVTX C API type and value. More...
 
constexpr value_type get_value () const noexcept
 Return the union holding the value of the payload. More...
 
constexpr nvtxPayloadType_t get_type () const noexcept
 Return the information about the type the union holds. More...
 

Detailed Description

A numerical value that can be associated with an NVTX event via its event_attributes.

Example:

// Constructs a payload from the int32_t value 42
nvtx3:: event_attributes attr{nvtx3::payload{42}};
// `range0` will have an int32_t payload of 42
nvtx3::scoped_range range0{attr};
// range1 has double payload of 3.14
nvtx3::scoped_range range1{nvtx3::payload{3.14}};
A numerical value that can be associated with an NVTX event via its event_attributes.
Definition: nvtx3.hpp:1753

Definition at line 1753 of file nvtx3.hpp.

Member Typedef Documentation

◆ value_type

using nvtx3::v1::payload::value_type = typename nvtxEventAttributes_v2::payload_t

Definition at line 1755 of file nvtx3.hpp.

Constructor & Destructor Documentation

◆ payload() [1/7]

nvtx3::v1::payload::payload ( int64_t  value)
inlineexplicitnoexcept

Construct a payload from a signed, 8 byte integer.

Parameters
valueValue to use as contents of the payload

Definition at line 1762 of file nvtx3.hpp.

◆ payload() [2/7]

nvtx3::v1::payload::payload ( int32_t  value)
inlineexplicitnoexcept

Construct a payload from a signed, 4 byte integer.

Parameters
valueValue to use as contents of the payload

Definition at line 1773 of file nvtx3.hpp.

◆ payload() [3/7]

nvtx3::v1::payload::payload ( uint64_t  value)
inlineexplicitnoexcept

Construct a payload from an unsigned, 8 byte integer.

Parameters
valueValue to use as contents of the payload

Definition at line 1784 of file nvtx3.hpp.

◆ payload() [4/7]

nvtx3::v1::payload::payload ( uint32_t  value)
inlineexplicitnoexcept

Construct a payload from an unsigned, 4 byte integer.

Parameters
valueValue to use as contents of the payload

Definition at line 1795 of file nvtx3.hpp.

◆ payload() [5/7]

nvtx3::v1::payload::payload ( float  value)
inlineexplicitnoexcept

Construct a payload from a single-precision floating point value.

Parameters
valueValue to use as contents of the payload

Definition at line 1807 of file nvtx3.hpp.

◆ payload() [6/7]

nvtx3::v1::payload::payload ( double  value)
inlineexplicitnoexcept

Construct a payload from a double-precision floating point value.

Parameters
valueValue to use as contents of the payload

Definition at line 1819 of file nvtx3.hpp.

◆ payload() [7/7]

constexpr nvtx3::v1::payload::payload ( nvtxPayloadType_t const &  type,
value_type const &  value 
)
inlineconstexprnoexcept

Construct a payload from NVTX C API type and value.

Parameters
typenvtxPayloadType_t enum value indicating type of the payload
valuenvtxEventAttributes_t::payload_t union containing payload

Definition at line 1831 of file nvtx3.hpp.

Member Function Documentation

◆ get_type()

constexpr nvtxPayloadType_t nvtx3::v1::payload::get_type ( ) const
inlineconstexprnoexcept

Return the information about the type the union holds.

Definition at line 1848 of file nvtx3.hpp.

◆ get_value()

constexpr value_type nvtx3::v1::payload::get_value ( ) const
inlineconstexprnoexcept

Return the union holding the value of the payload.

Definition at line 1842 of file nvtx3.hpp.


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