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

Wrapper around the NVTX C API nvtxPayloadData_t struct. More...

#include <nvtx3.hpp>

Public Member Functions

 payload_data (nvtxPayloadData_t const &pd)
 Constructs payload_data from an existing NVTX C API struct.
 
template<typename R , typename T = typename std::remove_cv<typename std::remove_reference<R>::type>::type, typename = typename std::enable_if<!std::is_same<T, nvtxPayloadData_t>::value>::type>
 payload_data (R &&t)
 Constructs payload_data for a specific payload struct instance.
 
template<typename T >
 payload_data (T const &t, schema s)
 Constructs payload_data for a payload instance with a given schema.
 
uint64_t as_ull_value () const noexcept
 

Detailed Description

Wrapper around the NVTX C API nvtxPayloadData_t struct.

This class facilitates associating a structured payload with an NVTX event. It combines a pointer to the payload data instance with its registered schema ID and size.

Definition at line 2105 of file nvtx3.hpp.

Constructor & Destructor Documentation

◆ payload_data() [1/3]

nvtx3::v1::mv1::payload_data::payload_data ( nvtxPayloadData_t const &  pd)
inlineexplicit

Constructs payload_data from an existing NVTX C API struct.

Provides interoperability with code using the NVTX C API directly.

Parameters
pdAn existing nvtxPayloadData_t struct.

Definition at line 2115 of file nvtx3.hpp.

◆ payload_data() [2/3]

template<typename R , typename T = typename std::remove_cv<typename std::remove_reference<R>::type>::type, typename = typename std::enable_if<!std::is_same<T, nvtxPayloadData_t>::value>::type>
nvtx3::v1::mv1::payload_data::payload_data ( R &&  t)
inlineexplicit

Constructs payload_data for a specific payload struct instance.

This template constructor automatically retrieves the necessary information from the given struct type T and the reference to the instance. The type T must be standard layout and trivially copyable as well as have a schema::get<T>() specialization via NVTX3_DEFINE_SCHEMA_GET (NVTX3_V1_DEFINE_SCHEMA_GET()).

Make sure the provided referenace is valid for the lifetime of the created payload_data object.

Parameters
tA constant reference to the payload struct instance.

Definition at line 2140 of file nvtx3.hpp.

◆ payload_data() [3/3]

template<typename T >
nvtx3::v1::mv1::payload_data::payload_data ( T const &  t,
schema  s 
)
inlineexplicit

Constructs payload_data for a payload instance with a given schema.

Use this constructor if you have a dynamic schema for your struct rather than a static one defined by NVTX3_DEFINE_SCHEMA_GET (NVTX3_V1_DEFINE_SCHEMA_GET()).

Make sure the provided referenace is valid for the lifetime of the created payload_data object.

Parameters
tA constant reference to the payload struct instance.
sThe schema to use for the payload data.

Definition at line 2167 of file nvtx3.hpp.

Member Function Documentation

◆ as_ull_value()

uint64_t nvtx3::v1::mv1::payload_data::as_ull_value ( ) const
inlinenoexcept
Returns
A pointer to the nvtxPayloadData_t struct as ullValue to use with NVTX C API functions.

Definition at line 2179 of file nvtx3.hpp.


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