NVTX C++ API Reference 1.0
C++ convenience wrappers for NVTX v3 C API
|
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 |
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.
|
inlineexplicit |
Constructs payload_data
from an existing NVTX C API struct.
Provides interoperability with code using the NVTX C API directly.
pd | An existing nvtxPayloadData_t struct. |
|
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.
t | A constant reference to the payload struct instance. |
|
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.
t | A constant reference to the payload struct instance. |
s | The schema to use for the payload data. |
|
inlinenoexcept |