22#define NVTX3_CPP_VERSION_MAJOR 1
23#define NVTX3_CPP_VERSION_MINOR 0
45#if !defined(NVTX3_CPP_REQUIRE_EXPLICIT_VERSION)
49 #define NVTX3_INLINE_THIS_VERSION
51 #if !defined(NVTX3_CPP_INLINED_VERSION_MAJOR)
66 #define NVTX3_CPP_INLINED_VERSION_MAJOR 1
78 #define NVTX3_CPP_INLINED_VERSION_MINOR 0
79 #elif NVTX3_CPP_INLINED_VERSION_MAJOR != NVTX3_CPP_VERSION_MAJOR
84 "Two different major versions of the NVTX C++ Wrappers are being included in a single .cpp file, with unversioned symbols enabled in both. Only one major version can enable unversioned symbols in a .cpp file. To disable unversioned symbols, #define NVTX3_CPP_REQUIRE_EXPLICIT_VERSION before #including nvtx3.hpp, and use the explicit-version symbols instead -- this is the preferred way to use nvtx3.hpp from a header file."
85 #elif (NVTX3_CPP_INLINED_VERSION_MAJOR == NVTX3_CPP_VERSION_MAJOR) && \
86 (NVTX3_CPP_INLINED_VERSION_MINOR < NVTX3_CPP_VERSION_MINOR)
91 #undef NVTX3_CPP_INLINED_VERSION_MINOR
92 #define NVTX3_CPP_INLINED_VERSION_MINOR 0
586#if !defined(NVTX3_USE_CHECKED_OVERLOADS_FOR_GET)
587#if defined(_MSC_VER) && _MSC_VER < 1914 \
588 || defined(__GNUC__) && __GNUC__ == 8 && __GNUC_MINOR__ < 4
589#define NVTX3_USE_CHECKED_OVERLOADS_FOR_GET 0
591#define NVTX3_USE_CHECKED_OVERLOADS_FOR_GET 1
593#define NVTX3_USE_CHECKED_OVERLOADS_FOR_GET_DEFINED_HERE
598#define NVTX3_CONCAT(A, B) A##B
599#define NVTX3_NAMESPACE_FOR(VERSION) NVTX3_CONCAT(v, VERSION)
600#define NVTX3_VERSION_NAMESPACE NVTX3_NAMESPACE_FOR(NVTX3_CPP_VERSION_MAJOR)
605#if defined(NVTX3_INLINE_THIS_VERSION)
606#define NVTX3_INLINE_IF_REQUESTED inline
608#define NVTX3_INLINE_IF_REQUESTED
621#if __cpp_constexpr >= 201304L
622#define NVTX3_CONSTEXPR_IF_CPP14 constexpr
624#define NVTX3_CONSTEXPR_IF_CPP14
628#if !defined(__has_cpp_attribute)
629#define __has_cpp_attribute(x) 0
631#if __has_cpp_attribute(maybe_unused)
632#define NVTX3_MAYBE_UNUSED [[maybe_unused]]
634#define NVTX3_MAYBE_UNUSED
636#if __has_cpp_attribute(nodiscard)
637#define NVTX3_NO_DISCARD [[nodiscard]]
639#define NVTX3_NO_DISCARD
647#if !defined(NVTX3_STATIC_ASSERT)
648#define NVTX3_STATIC_ASSERT(condition, message) static_assert(condition, message)
649#define NVTX3_STATIC_ASSERT_DEFINED_HERE
654#ifndef NVTX3_CPP_DEFINITIONS_V1_0
655#define NVTX3_CPP_DEFINITIONS_V1_0
657#include "nvToolsExt.h"
661#include <type_traits>
667NVTX3_INLINE_IF_REQUESTED
namespace NVTX3_VERSION_NAMESPACE
672template <
typename Unused>
673struct always_false : std::false_type {};
675template <
typename T,
typename =
void>
676struct has_name : std::false_type {};
678struct has_name<T, decltype((void)T::name, void())> : std::true_type {};
680template <
typename T,
typename =
void>
681struct has_id : std::false_type {};
683struct has_id<T, decltype((void)T::id, void())> : std::true_type {};
685template <
typename T,
typename =
void>
686struct has_message : std::false_type {};
688struct has_message<T, decltype((void)T::message, void())> : std::true_type {};
690template <
typename T,
typename =
void>
691struct is_c_string : std::false_type {};
693struct is_c_string<T, typename std::enable_if<
694 std::is_convertible<T, char const* >::value ||
695 std::is_convertible<T, wchar_t const*>::value
696>::type> : std::true_type {};
699using is_uint32 = std::is_same<typename std::decay<T>::type, uint32_t>;
777#if NVTX3_USE_CHECKED_OVERLOADS_FOR_GET
822 template <
typename D =
global,
823 typename std::enable_if<
824 detail::is_c_string<
decltype(D::name)>::value
828 static domain const d(D::name);
837 template <
typename D = global,
838 typename std::enable_if<
839 !detail::is_c_string<
decltype(D::name)>::value
843 NVTX3_STATIC_ASSERT(detail::always_false<D>::value,
844 "Type used to identify an NVTX domain must contain a static constexpr member "
845 "called 'name' of type const char* or const wchar_t* -- 'name' member is not "
846 "convertible to either of those types");
847 static domain const unused;
855 template <
typename D = global,
856 typename std::enable_if<
857 !detail::has_name<D>::value
861 NVTX3_STATIC_ASSERT(detail::always_false<D>::value,
862 "Type used to identify an NVTX domain must contain a static constexpr member "
863 "called 'name' of type const char* or const wchar_t* -- 'name' member is missing");
864 static domain const unused;
868 template <
typename D = global>
869 NVTX3_NO_DISCARD
static domain const& get() noexcept
871 static domain const d(D::name);
882 operator nvtxDomainHandle_t() const noexcept {
return _domain; }
893 explicit domain(
char const* name) noexcept : _domain{nvtxDomainCreateA(name)} {}
903 explicit domain(
wchar_t const* name) noexcept : _domain{nvtxDomainCreateW(name)} {}
913 explicit domain(std::string
const& name) noexcept : domain{name.c_str()} {}
923 explicit domain(std::wstring
const& name) noexcept : domain{name.c_str()} {}
933 constexpr domain() noexcept {}
952 nvtxDomainHandle_t
const _domain{};
969NVTX3_NO_DISCARD
inline domain const& domain::get<domain::global>() noexcept
998 : red{red_}, green{green_}, blue{blue_}
1030 :
rgb{red_, green_, blue_}, alpha{alpha_}
1077 :
color{from_bytes_msb_to_lsb(argb_.alpha, argb_.red, argb_.green, argb_.blue)}
1090 :
color{from_bytes_msb_to_lsb(0xFF, rgb_.red, rgb_.green, rgb_.blue)}
1104 constexpr nvtxColorType_t
get_type() const noexcept {
return _type; }
1119 constexpr static value_type from_bytes_msb_to_lsb(
1123 uint8_t byte0)
noexcept
1125 return uint32_t{byte3} << 24 | uint32_t{byte2} << 16 | uint32_t{byte1} << 8 | uint32_t{byte0};
1128 value_type _value{};
1129 nvtxColorType_t _type{NVTX_COLOR_ARGB};
1235template <
typename D = domain::global>
1238#if NVTX3_USE_CHECKED_OVERLOADS_FOR_GET
1273 template <
typename C,
1274 typename std::enable_if<
1275 detail::is_c_string<
decltype(C::name)>::value &&
1276 detail::is_uint32<
decltype(C::id)>::value
1290 template <
typename C,
1291 typename std::enable_if<
1292 !detail::is_c_string<
decltype(C::name)>::value ||
1293 !detail::is_uint32<
decltype(C::id)>::value
1297 NVTX3_STATIC_ASSERT(detail::is_c_string<
decltype(C::name)>::value,
1298 "Type used to name an NVTX category must contain a static constexpr member "
1299 "called 'name' of type const char* or const wchar_t* -- 'name' member is not "
1300 "convertible to either of those types");
1301 NVTX3_STATIC_ASSERT(detail::is_uint32<
decltype(C::id)>::value,
1302 "Type used to name an NVTX category must contain a static constexpr member "
1303 "called 'id' of type uint32_t -- 'id' member is the wrong type");
1312 template <
typename C,
1313 typename std::enable_if<
1314 !detail::has_name<C>::value ||
1315 !detail::has_id<C>::value
1319 NVTX3_STATIC_ASSERT(detail::has_name<C>::value,
1320 "Type used to name an NVTX category must contain a static constexpr member "
1321 "called 'name' of type const char* or const wchar_t* -- 'name' member is missing");
1322 NVTX3_STATIC_ASSERT(detail::has_id<C>::value,
1323 "Type used to name an NVTX category must contain a static constexpr member "
1324 "called 'id' of type uint32_t -- 'id' member is missing");
1329 template <
typename C>
1355 nvtxDomainNameCategoryA(domain::get<D>(), get_id(), name);
1375 nvtxDomainNameCategoryW(domain::get<D>(), get_id(), name);
1435template <
typename D = domain::global>
1438#if NVTX3_USE_CHECKED_OVERLOADS_FOR_GET
1472 template <
typename M,
1473 typename std::enable_if<
1474 detail::is_c_string<
decltype(M::message)>::value
1487 template <
typename M,
1488 typename std::enable_if<
1489 !detail::is_c_string<
decltype(M::message)>::value
1493 NVTX3_STATIC_ASSERT(detail::always_false<M>::value,
1494 "Type used to register an NVTX string must contain a static constexpr member "
1495 "called 'message' of type const char* or const wchar_t* -- 'message' member is "
1496 "not convertible to either of those types");
1505 template <
typename M,
1506 typename std::enable_if<
1507 !detail::has_message<M>::value
1511 NVTX3_STATIC_ASSERT(detail::always_false<M>::value,
1512 "Type used to register an NVTX string must contain a static constexpr member "
1513 "called 'message' of type const char* or const wchar_t* -- 'message' member "
1519 template <
typename M>
1539 : handle_{nvtxDomainRegisterStringA(domain::get<D>(), msg)}
1569 : handle_{nvtxDomainRegisterStringW(domain::get<D>(), msg)}
1591 nvtxStringHandle_t
get_handle() const noexcept {
return handle_; }
1604 nvtxStringHandle_t handle_{};
1653 using value_type = nvtxMessageValue_t;
1660 NVTX3_CONSTEXPR_IF_CPP14
message(
char const* msg) noexcept : type_{NVTX_MESSAGE_TYPE_ASCII}
1687 NVTX3_CONSTEXPR_IF_CPP14
message(
wchar_t const* msg) noexcept : type_{NVTX_MESSAGE_TYPE_UNICODE}
1689 value_.unicode = msg;
1717 template <
typename D>
1719 : type_{NVTX_MESSAGE_TYPE_REGISTERED}
1721 value_.registered = msg.get_handle();
1731 nvtxMessageType_t
const& type,
1732 nvtxMessageValue_t
const& value) noexcept
1733 : type_{type}, value_(value)
1742 NVTX3_CONSTEXPR_IF_CPP14
message(nvtxStringHandle_t handle) noexcept
1743 : type_{NVTX_MESSAGE_TYPE_REGISTERED}
1745 value_.registered = handle;
1752 constexpr value_type
get_value() const noexcept {
return value_; }
1758 constexpr nvtxMessageType_t
get_type() const noexcept {
return type_; }
1761 nvtxMessageType_t type_{};
1762 nvtxMessageValue_t value_{};
1783 using value_type =
typename nvtxEventAttributes_v2::payload_t;
1790 NVTX3_CONSTEXPR_IF_CPP14
explicit payload(int64_t value) noexcept
1791 : type_{NVTX_PAYLOAD_TYPE_INT64}, value_{}
1793 value_.llValue = value;
1801 NVTX3_CONSTEXPR_IF_CPP14
explicit payload(int32_t value) noexcept
1802 : type_{NVTX_PAYLOAD_TYPE_INT32}, value_{}
1804 value_.iValue = value;
1812 NVTX3_CONSTEXPR_IF_CPP14
explicit payload(uint64_t value) noexcept
1813 : type_{NVTX_PAYLOAD_TYPE_UNSIGNED_INT64}, value_{}
1815 value_.ullValue = value;
1823 NVTX3_CONSTEXPR_IF_CPP14
explicit payload(uint32_t value) noexcept
1824 : type_{NVTX_PAYLOAD_TYPE_UNSIGNED_INT32}, value_{}
1826 value_.uiValue = value;
1835 NVTX3_CONSTEXPR_IF_CPP14
explicit payload(
float value) noexcept
1836 : type_{NVTX_PAYLOAD_TYPE_FLOAT}, value_{}
1838 value_.fValue = value;
1847 NVTX3_CONSTEXPR_IF_CPP14
explicit payload(
double value) noexcept
1848 : type_{NVTX_PAYLOAD_TYPE_DOUBLE}, value_{}
1850 value_.dValue = value;
1860 nvtxPayloadType_t
const& type,
1861 value_type
const& value) noexcept
1862 : type_{type}, value_(value)
1870 constexpr value_type
get_value() const noexcept {
return value_; }
1876 constexpr nvtxPayloadType_t
get_type() const noexcept {
return type_; }
1879 nvtxPayloadType_t type_;
1943 using value_type = nvtxEventAttributes_t;
1952 sizeof(nvtxEventAttributes_t),
1956 NVTX_PAYLOAD_UNKNOWN,
1959 NVTX_MESSAGE_UNKNOWN,
1972 template <
typename... Args>
1976 attributes_.category = c.get_id();
1986 template <
typename... Args>
1990 attributes_.color = c.get_value();
1991 attributes_.colorType = c.get_type();
2001 template <
typename... Args>
2005 attributes_.payload = p.get_value();
2006 attributes_.payloadType = p.get_type();
2016 template <
typename... Args>
2020 attributes_.message = m.get_value();
2021 attributes_.messageType = m.get_type();
2034 constexpr value_type
const*
get() const noexcept {
return &attributes_; }
2037 value_type attributes_{};
2087template <
class D = domain::global>
2107 nvtxDomainRangePushEx(domain::get<D>(), attr.get());
2133 template <
typename... Args>
2152 void*
operator new(std::size_t) =
delete;
2165 nvtxDomainRangePop(domain::get<D>());
2179template <
typename D = domain::global>
2180class NVTX3_MAYBE_UNUSED optional_scoped_range_in
2183 optional_scoped_range_in() =
default;
2192 if (initialized) {
return; }
2194 nvtxDomainRangePushEx(domain::get<D>(), attr.
get());
2199 ~optional_scoped_range_in()
noexcept
2202 if (initialized) { nvtxDomainRangePop(domain::get<D>()); }
2206 void*
operator new(std::size_t) =
delete;
2207 optional_scoped_range_in(optional_scoped_range_in
const&) =
delete;
2208 optional_scoped_range_in& operator=(optional_scoped_range_in
const&) =
delete;
2209 optional_scoped_range_in(optional_scoped_range_in&&) =
delete;
2210 optional_scoped_range_in& operator=(optional_scoped_range_in&&) =
delete;
2214 bool initialized =
false;
2258 constexpr explicit operator
bool() const noexcept {
return get_value() != null_range_id; }
2277 static constexpr value_type null_range_id = nvtxRangeId_t{0};
2279 value_type _range_id{null_range_id};
2290 return lhs.get_value() == rhs.get_value();
2330template <
typename D = domain::global>
2334 return range_handle{nvtxDomainRangeStartEx(domain::get<D>(), attr.get())};
2371template <
typename D = domain::global,
typename... Args>
2410 return start_range_in<domain::global>(attr);
2444template <
typename... Args>
2448 return start_range_in<domain::global>(args...);
2469template <
typename D = domain::global>
2473 nvtxDomainRangeEnd(domain::get<D>(), r.get_value());
2495 end_range_in<domain::global>(r);
2522template <
typename D = domain::global>
2539 : handle_{start_range_in<D>(attr)}
2562 template <
typename... Args>
2607 struct end_range_handle {
2609 void operator()(
range_handle h)
const noexcept { end_range_in<D>(h); }
2613 std::unique_ptr<range_handle, end_range_handle> handle_;
2645template <
typename D = domain::global>
2649 nvtxDomainMarkEx(domain::get<D>(), attr.get());
2682template <
typename D = domain::global,
typename... Args>
2713 mark_in<domain::global>(attr);
2741template <
typename... Args>
2742inline void mark(Args
const&... args)
noexcept
2745 mark_in<domain::global>(args...);
2782#define NVTX3_V1_FUNC_RANGE_IN(D) \
2783 static ::nvtx3::v1::registered_string_in<D> const nvtx3_func_name__{__func__}; \
2784 static ::nvtx3::v1::event_attributes const nvtx3_func_attr__{nvtx3_func_name__}; \
2785 ::nvtx3::v1::scoped_range_in<D> const nvtx3_range__{nvtx3_func_attr__};
2803#define NVTX3_V1_FUNC_RANGE_IF_IN(D, C) \
2804 ::nvtx3::v1::detail::optional_scoped_range_in<D> optional_nvtx3_range__; \
2806 static ::nvtx3::v1::registered_string_in<D> const nvtx3_func_name__{__func__}; \
2807 static ::nvtx3::v1::event_attributes const nvtx3_func_attr__{nvtx3_func_name__}; \
2808 optional_nvtx3_range__.begin(nvtx3_func_attr__); \
2811#define NVTX3_V1_FUNC_RANGE_IN(D)
2812#define NVTX3_V1_FUNC_RANGE_IF_IN(D, C)
2837#define NVTX3_V1_FUNC_RANGE() NVTX3_V1_FUNC_RANGE_IN(::nvtx3::v1::domain::global)
2850#define NVTX3_V1_FUNC_RANGE_IF(C) NVTX3_V1_FUNC_RANGE_IF_IN(::nvtx3::v1::domain::global, C)
2854#if defined(NVTX3_INLINE_THIS_VERSION)
2856#define NVTX3_FUNC_RANGE NVTX3_V1_FUNC_RANGE
2857#define NVTX3_FUNC_RANGE_IF NVTX3_V1_FUNC_RANGE_IF
2858#define NVTX3_FUNC_RANGE_IN NVTX3_V1_FUNC_RANGE_IN
2859#define NVTX3_FUNC_RANGE_IF_IN NVTX3_V1_FUNC_RANGE_IF_IN
2896#undef NVTX3_CPP_VERSION_MAJOR
2897#undef NVTX3_CPP_VERSION_MINOR
2899#undef NVTX3_NAMESPACE_FOR
2900#undef NVTX3_VERSION_NAMESPACE
2901#undef NVTX3_INLINE_IF_REQUESTED
2902#undef NVTX3_CONSTEXPR_IF_CPP14
2903#undef NVTX3_MAYBE_UNUSED
2904#undef NVTX3_NO_DISCARD
2906#if defined(NVTX3_INLINE_THIS_VERSION)
2907#undef NVTX3_INLINE_THIS_VERSION
2910#if defined(NVTX3_USE_CHECKED_OVERLOADS_FOR_GET_DEFINED_HERE)
2911#undef NVTX3_USE_CHECKED_OVERLOADS_FOR_GET_DEFINED_HERE
2912#undef NVTX3_USE_CHECKED_OVERLOADS_FOR_GET
2915#if defined(NVTX3_STATIC_ASSERT_DEFINED_HERE)
2916#undef NVTX3_STATIC_ASSERT_DEFINED_HERE
2917#undef NVTX3_STATIC_ASSERT
Object for intra-domain grouping of NVTX events.
constexpr category(id_type id) noexcept
Construct a category with the specified id.
constexpr id_type get_id() const noexcept
Returns the id of the category.
uint32_t id_type
Type used for categorys integer id.
Represents a custom color that can be associated with an NVTX event via its event_attributes.
constexpr value_type get_value() const noexcept
Returns the colors argb hex code.
constexpr color(rgb rgb_) noexcept
Construct a color using the red, green, blue components in rgb.
uint32_t value_type
Type used for the color's value.
constexpr color(value_type hex_code) noexcept
Constructs a color using the value provided by hex_code.
constexpr color(argb argb_) noexcept
Construct a color using the alpha, red, green, blue components in argb.
constexpr nvtxColorType_t get_type() const noexcept
Return the NVTX color type of the color.
domains allow for grouping NVTX events into a single scope to differentiate them from events in other...
static domain const & get() noexcept
Returns reference to an instance of a function local static domain object.
Describes the attributes of a NVTX event.
event_attributes(color const &c, Args const &... args) noexcept
Variadic constructor where the first argument is a color.
event_attributes(category const &c, Args const &... args) noexcept
Variadic constructor where the first argument is a category.
constexpr value_type const * get() const noexcept
Get raw pointer to underlying NVTX attributes object.
event_attributes(payload const &p, Args const &... args) noexcept
Variadic constructor where the first argument is a payload.
event_attributes(message const &m, Args const &... args) noexcept
Variadic constructor where the first argument is a message.
constexpr event_attributes() noexcept
Default constructor creates an event_attributes with no category, color, payload, nor message.
Allows associating a message string with an NVTX event via its EventAttributes.
message(std::string const &msg) noexcept
Construct a message whose contents are specified by msg.
message(wchar_t const *msg) noexcept
Construct a message whose contents are specified by msg.
constexpr value_type get_value() const noexcept
Return the union holding the value of the message.
message(registered_string_in< D > const &msg) noexcept
Construct a message from a registered_string_in.
message(std::wstring &&)=delete
Disallow construction for std::wstring r-value.
constexpr nvtxMessageType_t get_type() const noexcept
Return the type information about the value the union holds.
message(nvtxStringHandle_t handle) noexcept
Construct a message from NVTX C API registered string handle.
message(char const *msg) noexcept
Construct a message whose contents are specified by msg.
constexpr message(nvtxMessageType_t const &type, nvtxMessageValue_t const &value) noexcept
Construct a message from NVTX C API type and value.
message(std::string &&)=delete
Disallow construction for std::string r-value.
message(std::wstring const &msg) noexcept
Construct a message whose contents are specified by msg.
A category with an associated name string.
named_category_in(id_type id, wchar_t const *name) noexcept
Construct a named_category_in with the specified id and name.
static named_category_in const & get() noexcept
Returns a global instance of a named_category_in as a function-local static.
named_category_in(id_type id, char const *name) noexcept
Construct a named_category_in with the specified id and name.
A numerical value that can be associated with an NVTX event via its event_attributes.
payload(int32_t value) noexcept
Construct a payload from a signed, 4 byte integer.
constexpr payload(nvtxPayloadType_t const &type, value_type const &value) noexcept
Construct a payload from NVTX C API type and value.
payload(uint32_t value) noexcept
Construct a payload from an unsigned, 4 byte integer.
payload(int64_t value) noexcept
Construct a payload from a signed, 8 byte integer.
payload(float value) noexcept
Construct a payload from a single-precision floating point value.
payload(double value) noexcept
Construct a payload from a double-precision floating point value.
constexpr value_type get_value() const noexcept
Return the union holding the value of the payload.
constexpr nvtxPayloadType_t get_type() const noexcept
Return the information about the type the union holds.
payload(uint64_t value) noexcept
Construct a payload from an unsigned, 8 byte integer.
A message registered with NVTX.
registered_string_in(char const *msg) noexcept
Constructs a registered_string_in from the specified msg string.
nvtxStringHandle_t get_handle() const noexcept
Returns the registered string's handle.
registered_string_in(std::string const &msg) noexcept
Constructs a registered_string_in from the specified msg string.
registered_string_in(std::wstring const &msg) noexcept
Constructs a registered_string_in from the specified msg string.
registered_string_in(wchar_t const *msg) noexcept
Constructs a registered_string_in from the specified msg string.
static registered_string_in const & get() noexcept
Returns a global instance of a registered_string_in as a function local static.
A RAII object for creating a NVTX range local to a thread within a domain.
scoped_range_in(event_attributes const &attr) noexcept
Construct a scoped_range_in with the specified event_attributes
scoped_range_in(Args const &... args) noexcept
Constructs a scoped_range_in from the constructor arguments of an event_attributes.
scoped_range_in() noexcept
Default constructor creates a scoped_range_in with no message, color, payload, nor category.
~scoped_range_in() noexcept
Destroy the scoped_range_in, ending the NVTX range event.
A RAII object for creating a NVTX range within a domain that can be created and destroyed on differen...
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(Args const &... args) noexcept
Constructs a unique_range_in from the constructor arguments of an event_attributes.
unique_range_in(event_attributes const &attr) noexcept
Construct a new unique_range_in object with the specified event attributes.
void end_range_in(range_handle r) noexcept
Manually end the range associated with the handle r in domain D.
void mark_in(event_attributes const &attr) noexcept
Annotates an instantaneous point in time with a "marker", using the attributes specified by attr.
range_handle start_range_in(event_attributes const &attr) noexcept
Manually begin an NVTX range.
range_handle start_range(event_attributes const &attr) noexcept
Manually begin an NVTX range in the global domain.
constexpr bool operator==(range_handle lhs, range_handle rhs) noexcept
Compares two range_handles for equality.
void mark(event_attributes const &attr) noexcept
Annotates an instantaneous point in time with a "marker", using the attributes specified by attr,...
constexpr bool operator!=(range_handle lhs, range_handle rhs) noexcept
Compares two range_handles for inequality.
void end_range(range_handle r) noexcept
Manually end the range associated with the handle r in the global domain.
Indicates the value of the alpha, red, green, and blue color channels for an ARGB color to use as an ...
constexpr argb(component_type alpha_, component_type red_, component_type green_, component_type blue_) noexcept
Construct an argb with alpha, red, green, and blue channels specified by alpha_, red_,...
Tag type for the "global" NVTX domain.
Handle used for correlating explicit range start and end events.
constexpr range_handle(value_type id) noexcept
Construct a range_handle from the given id.
constexpr value_type get_value() const noexcept
Returns the range_handle's value.
constexpr range_handle() noexcept=default
Constructs a null range handle.
nvtxRangeId_t value_type
Type used for the handle's value.
constexpr range_handle(std::nullptr_t) noexcept
Implicit conversion from nullptr constructs a null handle.
Indicates the values of the red, green, and blue color channels for an RGB color to use as an event a...
constexpr rgb(component_type red_, component_type green_, component_type blue_) noexcept
Construct a rgb with red, green, and blue channels specified by red_, green_, and blue_,...
uint8_t component_type
Type used for component values.