timemory 3.3.0
Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
tim::component::roctx_marker Struct Reference

Inserts ROCTX markers with the current timemory prefix. More...

#include "timemory/components/hip/components.hpp"

+ Collaboration diagram for tim::component::roctx_marker:

Public Types

using value_type = void
 
using this_type = roctx_marker
 
using base_type = base< this_type, value_type >
 
using storage_type = empty_storage
 

Public Member Functions

 roctx_marker (hip::stream_t _stream)
 construct with an specific HIP stream More...
 
void start ()
 start an roctx range. Equivalent to roctxRangeStartEx More...
 
void stop ()
 stop the roctx range. Equivalent to roctxRangeEnd. Depending on settings::roctx_marker_device_sync() this will either call hipDeviceSynchronize() or hipStreamSynchronize(m_stream) before stopping the range. More...
 
void mark_begin ()
 asynchronously add a marker. Equivalent to roctxMarkA More...
 
void mark_end ()
 asynchronously add a marker. Equivalent to roctxMarkA More...
 
void mark_begin (hip::stream_t _stream)
 asynchronously add a marker for a specific stream. Equivalent to roctxMarkA More...
 
void mark_end (hip::stream_t _stream)
 asynchronously add a marker for a specific stream. Equivalent to roctxMarkA More...
 
void set_stream (hip::stream_t _stream)
 set the current HIP stream More...
 
void set_prefix (const char *_prefix)
 set the label More...
 
auto get_range_id ()
 
auto get_stream ()
 
void get () const
 

Static Public Member Functions

static std::string label ()
 
static std::string description ()
 
static value_type record ()
 
static bool & use_device_sync ()
 
template<typename... Args>
static opaque get_opaque (Args &&...)
 

Detailed Description

Inserts ROCTX markers with the current timemory prefix.

Definition at line 252 of file components.hpp.

Member Typedef Documentation

◆ base_type

◆ storage_type

Definition at line 66 of file declaration.hpp.

◆ this_type

◆ value_type

Definition at line 254 of file components.hpp.

Constructor & Destructor Documentation

◆ roctx_marker()

tim::component::roctx_marker::roctx_marker ( hip::stream_t  _stream)
inlineexplicit

construct with an specific HIP stream

Definition at line 274 of file components.hpp.

275 : m_stream(_stream)
276 {}

Member Function Documentation

◆ description()

static std::string tim::component::roctx_marker::description ( )
inlinestatic

Definition at line 259 of file components.hpp.

260 {
261 return "Generates high-level region markers for HIP profilers";
262 }

◆ get()

void tim::component::empty_base::get ( ) const
inlineinherited

Definition at line 69 of file declaration.hpp.

69{}

◆ get_opaque()

template<typename... Args>
static opaque tim::component::empty_base::get_opaque ( Args &&  ...)
inlinestaticinherited

Definition at line 72 of file declaration.hpp.

73 {
74 return opaque{};
75 }

◆ get_range_id()

auto tim::component::roctx_marker::get_range_id ( )
inline

Definition at line 329 of file components.hpp.

329{ return m_range_id; }

◆ get_stream()

auto tim::component::roctx_marker::get_stream ( )
inline

Definition at line 330 of file components.hpp.

330{ return m_stream; }

◆ label()

static std::string tim::component::roctx_marker::label ( )
inlinestatic

Definition at line 258 of file components.hpp.

258{ return "roctx_marker"; }

◆ mark_begin() [1/2]

void tim::component::roctx_marker::mark_begin ( )
inline

asynchronously add a marker. Equivalent to roctxMarkA

Definition at line 299 of file components.hpp.

300 {
301 roctx::mark(TIMEMORY_JOIN("", m_prefix, "_begin_t", threading::get_id()));
302 }
void mark(TupleT< Tp... > &obj, Args &&... args)
Definition: functional.cpp:457
#define TIMEMORY_JOIN(delim,...)
Definition: macros.hpp:90

References tim::invoke::mark(), and TIMEMORY_JOIN.

◆ mark_begin() [2/2]

void tim::component::roctx_marker::mark_begin ( hip::stream_t  _stream)
inline

asynchronously add a marker for a specific stream. Equivalent to roctxMarkA

Definition at line 311 of file components.hpp.

312 {
313 roctx::mark(TIMEMORY_JOIN("", m_prefix, "_begin_t", threading::get_id(), "_s",
314 get_stream_id(_stream)));
315 }

References tim::invoke::mark(), and TIMEMORY_JOIN.

◆ mark_end() [1/2]

void tim::component::roctx_marker::mark_end ( )
inline

asynchronously add a marker. Equivalent to roctxMarkA

Definition at line 305 of file components.hpp.

306 {
307 roctx::mark(TIMEMORY_JOIN("", m_prefix, "_end_t", threading::get_id()));
308 }

References tim::invoke::mark(), and TIMEMORY_JOIN.

◆ mark_end() [2/2]

void tim::component::roctx_marker::mark_end ( hip::stream_t  _stream)
inline

asynchronously add a marker for a specific stream. Equivalent to roctxMarkA

Definition at line 318 of file components.hpp.

319 {
320 roctx::mark(TIMEMORY_JOIN("", m_prefix, "_end_t", threading::get_id(), "_s",
321 get_stream_id(_stream)));
322 }

References tim::invoke::mark(), and TIMEMORY_JOIN.

◆ record()

static value_type tim::component::roctx_marker::record ( )
inlinestatic

Definition at line 263 of file components.hpp.

263{}

◆ set_prefix()

void tim::component::roctx_marker::set_prefix ( const char *  _prefix)
inline

set the label

Definition at line 327 of file components.hpp.

327{ m_prefix = _prefix; }
char const std::string & _prefix
Definition: config.cpp:55

References tim::_prefix.

◆ set_stream()

void tim::component::roctx_marker::set_stream ( hip::stream_t  _stream)
inline

set the current HIP stream

Definition at line 325 of file components.hpp.

325{ m_stream = _stream; }

◆ start()

void tim::component::roctx_marker::start ( )
inline

start an roctx range. Equivalent to roctxRangeStartEx

Definition at line 279 of file components.hpp.

279{ m_range_id = roctx::range_start(m_prefix); }

◆ stop()

void tim::component::roctx_marker::stop ( )
inline

stop the roctx range. Equivalent to roctxRangeEnd. Depending on settings::roctx_marker_device_sync() this will either call hipDeviceSynchronize() or hipStreamSynchronize(m_stream) before stopping the range.

Definition at line 285 of file components.hpp.

286 {
287 if(use_device_sync())
288 {
289 hip::device_sync();
290 }
291 else
292 {
293 hip::stream_sync(m_stream);
294 }
295 roctx::range_stop(m_range_id);
296 }
static bool & use_device_sync()
Definition: components.hpp:265

References use_device_sync().

◆ use_device_sync()

static bool & tim::component::roctx_marker::use_device_sync ( )
inlinestatic

Definition at line 265 of file components.hpp.

266 {
267 static bool _instance = settings::nvtx_marker_device_sync();
268 return _instance;
269 }
nvtx_marker_device_sync
Definition: settings.cpp:1721

References tim::nvtx_marker_device_sync.

Referenced by stop().


The documentation for this struct was generated from the following file: