NVTX C++ API Reference 1.0
C++ convenience wrappers for NVTX v3 C API
|
Provides C++ constructs making the NVTX library safer and easier to use with zero overhead. More...
Go to the source code of this file.
Classes | |
class | nvtx3::v1::domain |
domain s allow for grouping NVTX events into a single scope to differentiate them from events in other domain s. More... | |
struct | nvtx3::v1::domain::global |
Tag type for the "global" NVTX domain. More... | |
struct | nvtx3::v1::rgb |
Indicates the values of the red, green, and blue color channels for an RGB color to use as an event attribute (assumes no transparency). More... | |
struct | nvtx3::v1::argb |
Indicates the value of the alpha, red, green, and blue color channels for an ARGB color to use as an event attribute. More... | |
class | nvtx3::v1::color |
Represents a custom color that can be associated with an NVTX event via its event_attributes . More... | |
class | nvtx3::v1::category |
Object for intra-domain grouping of NVTX events. More... | |
class | nvtx3::v1::named_category_in< D > |
A category with an associated name string. More... | |
class | nvtx3::v1::registered_string_in< D > |
A message registered with NVTX. More... | |
class | nvtx3::v1::message |
Allows associating a message string with an NVTX event via its EventAttribute s. More... | |
class | nvtx3::v1::payload |
A numerical value that can be associated with an NVTX event via its event_attributes . More... | |
class | nvtx3::v1::event_attributes |
Describes the attributes of a NVTX event. More... | |
class | nvtx3::v1::scoped_range_in< D > |
A RAII object for creating a NVTX range local to a thread within a domain. More... | |
struct | nvtx3::v1::range_handle |
Handle used for correlating explicit range start and end events. More... | |
class | nvtx3::v1::unique_range_in< D > |
A RAII object for creating a NVTX range within a domain that can be created and destroyed on different threads. More... | |
Macros | |
#define | NVTX3_CPP_VERSION_MAJOR 1 |
#define | NVTX3_CPP_VERSION_MINOR 0 |
#define | NVTX3_INLINE_THIS_VERSION |
#define | NVTX3_CPP_INLINED_VERSION_MAJOR 1 |
Semantic major version number for NVTX C++ wrappers of unversioned symbols. | |
#define | NVTX3_CPP_INLINED_VERSION_MINOR 0 |
Semantic minor version number for NVTX C++ wrappers of unversioned symbols. | |
#define | NVTX3_USE_CHECKED_OVERLOADS_FOR_GET 1 |
#define | NVTX3_USE_CHECKED_OVERLOADS_FOR_GET_DEFINED_HERE |
#define | NVTX3_CONCAT(A, B) A##B |
#define | NVTX3_NAMESPACE_FOR(VERSION) NVTX3_CONCAT(v, VERSION) |
#define | NVTX3_VERSION_NAMESPACE NVTX3_NAMESPACE_FOR(NVTX3_CPP_VERSION_MAJOR) |
#define | NVTX3_INLINE_IF_REQUESTED inline |
#define | NVTX3_CONSTEXPR_IF_CPP14 |
#define | __has_cpp_attribute(x) 0 |
#define | NVTX3_MAYBE_UNUSED |
#define | NVTX3_NO_DISCARD |
#define | NVTX3_STATIC_ASSERT(condition, message) static_assert(condition, message) |
#define | NVTX3_STATIC_ASSERT_DEFINED_HERE |
#define | NVTX3_CPP_DEFINITIONS_V1_0 |
#define | NVTX3_V1_FUNC_RANGE_IN(D) |
Convenience macro for generating a range in the specified domain from the lifetime of a function. | |
#define | NVTX3_V1_FUNC_RANGE_IF_IN(D, C) |
Convenience macro for generating a range in the specified domain from the lifetime of a function if the given boolean expression evaluates to true. | |
#define | NVTX3_V1_FUNC_RANGE() NVTX3_V1_FUNC_RANGE_IN(::nvtx3::v1::domain::global) |
Convenience macro for generating a range in the global domain from the lifetime of a function. | |
#define | NVTX3_V1_FUNC_RANGE_IF(C) NVTX3_V1_FUNC_RANGE_IF_IN(::nvtx3::v1::domain::global, C) |
Convenience macro for generating a range in the global domain from the lifetime of a function if the given boolean expression evaluates to true. | |
#define | NVTX3_FUNC_RANGE NVTX3_V1_FUNC_RANGE |
#define | NVTX3_FUNC_RANGE_IF NVTX3_V1_FUNC_RANGE_IF |
#define | NVTX3_FUNC_RANGE_IN NVTX3_V1_FUNC_RANGE_IN |
#define | NVTX3_FUNC_RANGE_IF_IN NVTX3_V1_FUNC_RANGE_IF_IN |
Typedefs | |
template<typename T > | |
using | nvtx3::v1::detail::is_uint32 = std::is_same< typename std::decay< T >::type, uint32_t > |
using | nvtx3::named_category = named_category_in< domain::global > |
Alias for a named_category_in in the global NVTX domain. | |
using | nvtx3::registered_string = registered_string_in< domain::global > |
Alias for a registered_string_in in the global NVTX domain. | |
using | nvtx3::scoped_range = scoped_range_in< domain::global > |
Alias for a scoped_range_in in the global NVTX domain. | |
using | nvtx3::unique_range = unique_range_in< domain::global > |
Alias for a unique_range_in in the global NVTX domain. | |
Functions | |
template<> | |
domain const & | nvtx3::domain::get< domain::global > () noexcept |
Returns reference to the domain object that represents the global NVTX domain. | |
constexpr bool | nvtx3::operator== (range_handle lhs, range_handle rhs) noexcept |
Compares two range_handles for equality. | |
constexpr bool | nvtx3::operator!= (range_handle lhs, range_handle rhs) noexcept |
Compares two range_handles for inequality. | |
template<typename D = domain::global> | |
range_handle | nvtx3::start_range_in (event_attributes const &attr) noexcept |
Manually begin an NVTX range. | |
template<typename D = domain::global, typename... Args> | |
range_handle | nvtx3::start_range_in (Args const &... args) noexcept |
Manually begin an NVTX range. | |
range_handle | nvtx3::start_range (event_attributes const &attr) noexcept |
Manually begin an NVTX range in the global domain. | |
template<typename... Args> | |
range_handle | nvtx3::start_range (Args const &... args) noexcept |
Manually begin an NVTX range in the global domain. | |
template<typename D = domain::global> | |
void | nvtx3::end_range_in (range_handle r) noexcept |
Manually end the range associated with the handle r in domain D . | |
void | nvtx3::end_range (range_handle r) noexcept |
Manually end the range associated with the handle r in the global domain. | |
template<typename D = domain::global> | |
void | nvtx3::mark_in (event_attributes const &attr) noexcept |
Annotates an instantaneous point in time with a "marker", using the attributes specified by attr . | |
template<typename D = domain::global, typename... Args> | |
void | nvtx3::mark_in (Args const &... args) noexcept |
Annotates an instantaneous point in time with a "marker", using the arguments to construct an event_attributes . | |
void | nvtx3::mark (event_attributes const &attr) noexcept |
Annotates an instantaneous point in time with a "marker", using the attributes specified by attr , in the global domain. | |
template<typename... Args> | |
void | nvtx3::mark (Args const &... args) noexcept |
Annotates an instantaneous point in time with a "marker", using the arguments to construct an event_attributes , in the global domain. | |
Provides C++ constructs making the NVTX library safer and easier to use with zero overhead.
Definition in file nvtx3.hpp.
#define NVTX3_CPP_INLINED_VERSION_MAJOR 1 |
Semantic major version number for NVTX C++ wrappers of unversioned symbols.
Breaking changes may occur between major versions, and different major versions cannot provide unversioned symbols in the same translation unit (.cpp file).
Note: If NVTX3_CPP_REQUIRE_EXPLICIT_VERSION is defined, this macro is not defined.
Not to be confused with the version number of the NVTX core library.
#define NVTX3_CPP_INLINED_VERSION_MINOR 0 |
Semantic minor version number for NVTX C++ wrappers of unversioned symbols.
No breaking changes occur between minor versions – minor version changes within a major version are purely additive.
Note: If NVTX3_CPP_REQUIRE_EXPLICIT_VERSION is defined, this macro is not defined.
Not to be confused with the version number of the NVTX core library.
#define NVTX3_FUNC_RANGE NVTX3_V1_FUNC_RANGE |
#define NVTX3_FUNC_RANGE_IF NVTX3_V1_FUNC_RANGE_IF |
#define NVTX3_FUNC_RANGE_IF_IN NVTX3_V1_FUNC_RANGE_IF_IN |
#define NVTX3_FUNC_RANGE_IN NVTX3_V1_FUNC_RANGE_IN |
#define NVTX3_NAMESPACE_FOR | ( | VERSION | ) | NVTX3_CONCAT(v, VERSION) |
#define NVTX3_STATIC_ASSERT | ( | condition, | |
message | |||
) | static_assert(condition, message) |
#define NVTX3_V1_FUNC_RANGE | ( | ) | NVTX3_V1_FUNC_RANGE_IN(::nvtx3::v1::domain::global) |
Convenience macro for generating a range in the global domain from the lifetime of a function.
This macro is useful for generating an NVTX range in the global domain from the entry point of a function to its exit. It is intended to be the first line of the function.
Constructs a static registered_string_in
using the name of the immediately enclosing function returned by __func__
and constructs a nvtx3::scoped_range
using the registered function name as the range's message.
Example:
#define NVTX3_V1_FUNC_RANGE_IF | ( | C | ) | NVTX3_V1_FUNC_RANGE_IF_IN(::nvtx3::v1::domain::global, C) |
Convenience macro for generating a range in the global domain from the lifetime of a function if the given boolean expression evaluates to true.
Similar to NVTX3_V1_FUNC_RANGE()
, the only difference being that NVTX3_V1_FUNC_RANGE_IF(C)
only generates a range if the given boolean expression evaluates to true.
[in] | C | Boolean expression used to determine if a range should be generated. |
#define NVTX3_V1_FUNC_RANGE_IF_IN | ( | D, | |
C | |||
) |
Convenience macro for generating a range in the specified domain
from the lifetime of a function if the given boolean expression evaluates to true.
Similar to NVTX3_V1_FUNC_RANGE_IN(D)
, the only difference being that NVTX3_V1_FUNC_RANGE_IF_IN(D, C)
only generates a range if the given boolean expression evaluates to true.
[in] | D | Type containing name member used to identify the domain to which the registered_string_in belongs. Else, domain::global to indicate that the global NVTX domain should be used. |
[in] | C | Boolean expression used to determine if a range should be generated. |
#define NVTX3_V1_FUNC_RANGE_IN | ( | D | ) |
Convenience macro for generating a range in the specified domain
from the lifetime of a function.
This macro is useful for generating an NVTX range in domain
from the entry point of a function to its exit. It is intended to be the first line of the function.
Constructs a static registered_string_in
using the name of the immediately enclosing function returned by __func__
and constructs a nvtx3::scoped_range
using the registered function name as the range's message.
Example:
[in] | D | Type containing name member used to identify the domain to which the registered_string_in belongs. Else, domain::global to indicate that the global NVTX domain should be used. |
#define NVTX3_VERSION_NAMESPACE NVTX3_NAMESPACE_FOR(NVTX3_CPP_VERSION_MAJOR) |
using nvtx3::v1::detail::is_uint32 = typedef std::is_same<typename std::decay<T>::type, uint32_t> |
using nvtx3::v1::named_category = typedef named_category_in<domain::global> |
using nvtx3::v1::registered_string = typedef registered_string_in<domain::global> |
using nvtx3::v1::scoped_range = typedef scoped_range_in<domain::global> |
using nvtx3::v1::unique_range = typedef unique_range_in<domain::global> |
|
inlinenoexcept |
Returns reference to the domain
object that represents the global NVTX domain.
This specialization for domain::global
returns a default constructed, domain
object for use when the "global" domain is desired.
All NVTX events in the global domain across all libraries and applications will be grouped together.
domain
corresponding to the global NVTX domain.
|
inlinenoexcept |
Manually end the range associated with the handle r
in the global domain.
Explicitly ends the NVTX range indicated by the handle r
returned from a prior call to start_range
. The range may end on a different thread from where it began.
r | Handle to a range started by a prior call to start_range . |
start_range
call.
|
inlinenoexcept |
Manually end the range associated with the handle r
in domain D
.
Explicitly ends the NVTX range indicated by the handle r
returned from a prior call to start_range_in<D>
. The range may end on a different thread from where it began.
D | Type containing name member used to identify the domain to which the range belongs. Else, domain::global to indicate that the global NVTX domain should be used. |
r | Handle to a range started by a prior call to start_range_in . |
start_range_in
call.
|
inlinenoexcept |
Annotates an instantaneous point in time with a "marker", using the arguments to construct an event_attributes
, in the global domain.
Unlike a "range" which has a beginning and an end, a marker is a single event in an application, such as detecting a problem:
Note that nvtx3::mark is a function, not a class like scoped_range.
Forwards the arguments args...
to construct an event_attributes
object. The attributes are then associated with the marker. For more detail, see the event_attributes
documentation.
[in] | args | Variadic parameter pack of arguments to construct an event_attributes associated with this range. |
|
inlinenoexcept |
Annotates an instantaneous point in time with a "marker", using the attributes specified by attr
, in the global domain.
Unlike a "range" which has a beginning and an end, a marker is a single event in an application, such as detecting a problem:
Note that nvtx3::mark is a function, not a class like scoped_range.
[in] | attr | event_attributes that describes the desired attributes of the mark. |
|
inlinenoexcept |
Annotates an instantaneous point in time with a "marker", using the arguments to construct an event_attributes
.
Unlike a "range" which has a beginning and an end, a marker is a single event in an application, such as detecting a problem:
Note that nvtx3::mark_in<D> is a function, not a class like scoped_range_in<D>.
Forwards the arguments args...
to construct an event_attributes
object. The attributes are then associated with the marker. For more detail, see the event_attributes
documentation.
D | Type containing name member used to identify the domain to which the unique_range_in belongs. Else domain::global to indicate that the global NVTX domain should be used. |
[in] | args | Variadic parameter pack of arguments to construct an event_attributes associated with this range. |
|
inlinenoexcept |
Annotates an instantaneous point in time with a "marker", using the attributes specified by attr
.
Unlike a "range" which has a beginning and an end, a marker is a single event in an application, such as detecting a problem:
Note that nvtx3::mark_in<D> is a function, not a class like scoped_range_in<D>.
D | Type containing name member used to identify the domain to which the unique_range_in belongs. Else, domain::global to indicate that the global NVTX domain should be used. |
[in] | attr | event_attributes that describes the desired attributes of the mark. |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinenoexcept |
Manually begin an NVTX range in the global domain.
Explicitly begins an NVTX range and returns a unique handle. To end the range, pass the handle to end_range_in<D>()
.
nvtx3::start_range(...)
is equivalent to nvtx3::start_range_in<>(...)
and nvtx3::start_range_in<nvtx3::domain::global>(...)
.
start_range_in/end_range_in
are the most explicit and lowest level APIs provided for creating ranges. Use of nvtx3::unique_range_in
should be preferred unless one is unable to tie the range to the lifetime of an object.
This overload uses args...
to construct an event_attributes
to associate with the range. For more detail, see event_attributes
.
Example:
[in] | args | Variadic parameter pack of the arguments for an event_attributes . |
end_range
to end the range.
|
inlinenoexcept |
Manually begin an NVTX range in the global domain.
Explicitly begins an NVTX range and returns a unique handle. To end the range, pass the handle to end_range()
.
nvtx3::start_range(...)
is equivalent to nvtx3::start_range_in<>(...)
and nvtx3::start_range_in<nvtx3::domain::global>(...)
.
start_range/end_range
are the most explicit and lowest level APIs provided for creating ranges. Use of nvtx3::unique_range
should be preferred unless one is unable to tie the range to the lifetime of an object.
Example:
[in] | attr | event_attributes that describes the desired attributes of the range. |
end_range_in
to end the range.
|
inlinenoexcept |
Manually begin an NVTX range.
Explicitly begins an NVTX range and returns a unique handle. To end the range, pass the handle to end_range_in<D>()
.
nvtx3::start_range(...)
is equivalent to nvtx3::start_range_in<>(...)
and nvtx3::start_range_in<nvtx3::domain::global>(...)
.
start_range_in/end_range_in
are the most explicit and lowest level APIs provided for creating ranges. Use of nvtx3::unique_range_in
should be preferred unless one is unable to tie the range to the lifetime of an object.
This overload uses args...
to construct an event_attributes
to associate with the range. For more detail, see event_attributes
.
Example:
D | Type containing name member used to identify the domain to which the range belongs. Else, domain::global to indicate that the global NVTX domain should be used. |
[in] | args | Variadic parameter pack of the arguments for an event_attributes . |
end_range
to end the range.
|
inlinenoexcept |
Manually begin an NVTX range.
Explicitly begins an NVTX range and returns a unique handle. To end the range, pass the handle to end_range_in<D>()
.
nvtx3::start_range(...)
is equivalent to nvtx3::start_range_in<>(...)
and nvtx3::start_range_in<nvtx3::domain::global>(...)
.
start_range_in/end_range_in
are the most explicit and lowest level APIs provided for creating ranges. Use of nvtx3::unique_range_in
should be preferred unless one is unable to tie the range to the lifetime of an object.
Example:
D | Type containing name member used to identify the domain to which the range belongs. Else, domain::global to indicate that the global NVTX domain should be used. |
[in] | attr | event_attributes that describes the desired attributes of the range. |
end_range_in
to end the range.