NVTX++
3.0
C++ convenience wrappers for NVTX.
|
Provides C++ constructs making the NVTX library safer and easier to use with zero overhead. More...
#include <nvToolsExt.h>
#include <string>
Go to the source code of this file.
Classes | |
class | nvtx3::domain |
domain s allow for grouping NVTX events into a single scope to differentiate them from events in other domain s. More... | |
struct | nvtx3::domain::global |
Tag type for the "global" NVTX domain. More... | |
struct | nvtx3::rgb |
Indicates the values of the red, green, blue color channels for a rgb color code. More... | |
struct | nvtx3::argb |
Indicates the value of the alpha, red, green, and blue color channels for an argb color code. More... | |
class | nvtx3::color |
Represents a custom color that can be associated with an NVTX event via it's event_attributes . More... | |
class | nvtx3::category |
Object for intra-domain grouping of NVTX events. More... | |
class | nvtx3::named_category< D > |
A category with an associated name string. More... | |
class | nvtx3::registered_message< D > |
A message registered with NVTX. More... | |
class | nvtx3::message |
Allows associating a message string with an NVTX event via its EventAttribute s. More... | |
class | nvtx3::payload |
A numerical value that can be associated with an NVTX event via its event_attributes . More... | |
class | nvtx3::event_attributes |
Describes the attributes of a NVTX event. More... | |
class | nvtx3::domain_thread_range< D > |
A RAII object for creating a NVTX range local to a thread within a domain. More... | |
class | nvtx3::domain_process_range< 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_MINOR_VERSION 0 |
Semantic minor version number. More... | |
#define | NVTX3_RELAXED_CONSTEXPR |
Enables the use of constexpr when support for C++14 relaxed constexpr is present. More... | |
#define | NVTX3_FUNC_RANGE_IN(D) |
Convenience macro for generating a range in the specified domain from the lifetime of a function. More... | |
#define | NVTX3_FUNC_RANGE() NVTX3_FUNC_RANGE_IN(::nvtx3::domain::global) |
Convenience macro for generating a range in the global domain from the lifetime of a function. More... | |
Typedefs | |
using | nvtx3::thread_range = domain_thread_range<> |
Alias for a domain_thread_range in the global NVTX domain. | |
using | nvtx3::process_range = domain_process_range<> |
Alias for a domain_process_range in the global NVTX domain. | |
Functions | |
template<typename T > | |
constexpr auto | nvtx3::detail::has_name_member () noexcept-> decltype(T::name, bool()) |
Verifies if a type T contains a member T::name of type const char* or const wchar_t* . More... | |
template<> | |
domain const & | nvtx3::domain::get< domain::global > () |
Returns reference to the domain object that represents the global NVTX domain. More... | |
template<typename D = nvtx3::domain::global> | |
void | nvtx3::mark (event_attributes const &attr) noexcept |
Annotates an instantaneous point in time with the attributes specified by attr . More... | |
Provides C++ constructs making the NVTX library safer and easier to use with zero overhead.
#define NVTX3_FUNC_RANGE | ( | ) | NVTX3_FUNC_RANGE_IN(::nvtx3::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_message
using the name of the immediately enclosing function returned by __func__
and constructs a nvtx3::thread_range
using the registered function name as the range's message.
Example:
#define NVTX3_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_message
using the name of the immediately enclosing function returned by __func__
and constructs a nvtx3::thread_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_message belongs. Else, domain::global to indicate that the global NVTX domain should be used. |
#define NVTX3_MINOR_VERSION 0 |
Semantic minor version number.
Major version number is hardcoded into the "nvtx3" namespace/prefix.
If this value is incremented, the above version include guard needs to be updated.
#define NVTX3_RELAXED_CONSTEXPR |
Enables the use of constexpr when support for C++14 relaxed constexpr is present.
Initializing a legacy-C (i.e., no constructor) union member requires initializing in the constructor body. Non-empty constexpr constructors require C++14 relaxed constexpr.
|
inline |
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.
|
noexcept |
Verifies if a type T
contains a member T::name
of type const char*
or const wchar_t*
.
T | The type to verify |
T
contains a member T::name
of type const char*
or const wchar_t*
.
|
inlinenoexcept |
Annotates an instantaneous point in time with the attributes specified by attr
.
Unlike a "range", a mark is an instantaneous event in an application, e.g., locking/unlocking a mutex.
D | Type containing name member used to identify the domain to which the domain_process_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 mark. |