|
NVTX++
3.0
C++ convenience wrappers for NVTX.
|
A message registered with NVTX. More...
#include <nvtx3.hpp>
Public Member Functions | |
| registered_message (char const *msg) noexcept | |
Constructs a registered_message from the specified msg string. More... | |
| registered_message (std::string const &msg) noexcept | |
Constructs a registered_message from the specified msg string. More... | |
| registered_message (wchar_t const *msg) noexcept | |
Constructs a registered_message from the specified msg string. More... | |
| registered_message (std::wstring const &msg) noexcept | |
Constructs a registered_message from the specified msg string. More... | |
| nvtxStringHandle_t | get_handle () const noexcept |
| Returns the registered message's handle. | |
| registered_message (registered_message const &)=default | |
| registered_message & | operator= (registered_message const &)=default |
| registered_message (registered_message &&)=default | |
| registered_message & | operator= (registered_message &&)=default |
Static Public Member Functions | |
| template<typename M > | |
| static registered_message< D > const & | get () noexcept |
Returns a global instance of a registered_message as a function local static. More... | |
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_message objects, or using the registered_message::get construct on first use helper (recommended).
Example:
registered_messages 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_message belongs. Else, domain::global to indicate that the global NVTX domain should be used. |
|
inlineexplicitnoexcept |
Constructs a registered_message 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_message 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_message 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_message 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_message 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_message 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 message's contents. |
registered_message associated with the type M.
1.8.11