NVTX C++ API Reference 1.0
C++ convenience wrappers for NVTX v3 C API
|
A message registered with NVTX. More...
#include <nvtx3.hpp>
Public Member Functions | |
registered_string_in (char const *msg) noexcept | |
Constructs a registered_string_in from the specified msg string. | |
registered_string_in (std::string 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. | |
registered_string_in (std::wstring 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 (registered_string_in const &)=default | |
registered_string_in & | operator= (registered_string_in const &)=default |
registered_string_in (registered_string_in &&)=default | |
registered_string_in & | operator= (registered_string_in &&)=default |
Static Public Member Functions | |
template<typename M , typename std::enable_if< detail::is_c_string< decltype(M::message)>::value, int >::type = 0> | |
static registered_string_in const & | get () noexcept |
Returns a global instance of a registered_string_in as a function local static. | |
template<typename M , typename std::enable_if< !detail::is_c_string< decltype(M::message)>::value, int >::type = 0> | |
static registered_string_in const & | get () noexcept |
Overload of registered_string_in::get to provide a clear compile error when M has a message member that is not directly convertible to either char const* or wchar_t const* . | |
template<typename M , typename std::enable_if< !detail::has_message< M >::value, int >::type = 0> | |
static registered_string_in const & | get () noexcept |
Overload of registered_string_in::get to provide a clear compile error when M does not have a message member. | |
A message registered with NVTX.
Normally, associating a message
with an NVTX event requires copying the contents of the message string. This may cause non-trivial overhead in highly performance sensitive regions of code.
message registration is an optimization to lower the overhead of associating a message with an NVTX event. Registering a message yields a handle that is inexpensive to copy that may be used in place of a message string.
A particular message should only be registered once and the handle reused throughout the rest of the application. This can be done by either explicitly creating static registered_string_in
objects, or using the registered_string_in::get
construct on first use helper (recommended).
Example:
registered_string_in
s are local to a particular domain specified via the type D
.
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. |
|
inlineexplicitnoexcept |
Constructs a registered_string_in
from the specified msg
string.
Registers msg
with NVTX and associates a handle with the registered message.
A particular message should should only be registered once and the handle reused throughout the rest of the application.
msg | The contents of the message |
|
inlineexplicitnoexcept |
Constructs a registered_string_in
from the specified msg
string.
Registers msg
with NVTX and associates a handle with the registered message.
A particular message should should only be registered once and the handle reused throughout the rest of the application.
msg | The contents of the message |
|
inlineexplicitnoexcept |
Constructs a registered_string_in
from the specified msg
string.
Registers msg
with NVTX and associates a handle with the registered message.
A particular message should should only be registered once and the handle reused throughout the rest of the application.
msg | The contents of the message |
|
inlineexplicitnoexcept |
Constructs a registered_string_in
from the specified msg
string.
Registers msg
with NVTX and associates a handle with the registered message.
A particular message should only be registered once and the handle reused throughout the rest of the application.
msg | The contents of the message |
|
inlinestaticnoexcept |
Returns a global instance of a registered_string_in
as a function local static.
Provides a convenient way to register a message with NVTX without having to explicitly register the message.
Upon first invocation, constructs a registered_string_in
whose contents are specified by message::message
.
All future invocations will return a reference to the object constructed in the first invocation.
Example:
M | Type required to contain a member M::message that resolves to either a char const* or wchar_t const* used as the registered string's contents. |
registered_string_in
associated with the type M
.
|
inlinestaticnoexcept |
Overload of registered_string_in::get
to provide a clear compile error when M
has a message
member that is not directly convertible to either char const*
or wchar_t const*
.
|
inlinestaticnoexcept |
Overload of registered_string_in::get
to provide a clear compile error when M
does not have a message
member.
|
inlinenoexcept |