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::caliper_loop_marker Struct Reference

Loop marker for the Caliper Performance Analysis Toolbox. More...

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

+ Collaboration diagram for tim::component::caliper_loop_marker:

Public Types

using value_type = void
 
using this_type = caliper_loop_marker
 
using base_type = base< this_type, value_type >
 
using value_type = void
 
using this_type = caliper_loop_marker
 
using base_type = base< this_type, value_type >
 
using storage_type = empty_storage
 
using attributes_t = int
 

Public Member Functions

void start ()
 
void stop ()
 
void mark_begin ()
 
void mark_end ()
 
template<typename T , enable_if_t< std::is_integral< T >::value, int > = 0>
void mark_begin (T itr)
 
template<typename T , enable_if_t< std::is_integral< T >::value, int > = 0>
void mark_end (T)
 
template<typename T , enable_if_t< std::is_integral< T >::value, int > = 0>
tim::scope::destructor record (T itr)
 
void set_prefix (const char *_prefix)
 
void get () const
 

Static Public Member Functions

static std::string label ()
 
static std::string description ()
 
static std::string label ()
 
static std::string description ()
 
template<typename... Args>
static opaque get_opaque (Args &&...)
 
static void _init ()
 
static void init ()
 
static std::string & get_channel ()
 
static attributes_tget_attributes ()
 
static attributes_t get_default_attributes ()
 
static attributes_t get_nested ()
 
static auto get_process_scope ()
 
static auto get_thread_scope ()
 
static auto get_task_scope ()
 
static void enable_process_scope ()
 
static void enable_thread_scope ()
 
static void enable_task_scope ()
 

Detailed Description

Loop marker for the Caliper Performance Analysis Toolbox.

Definition at line 68 of file components.hpp.

Member Typedef Documentation

◆ attributes_t

Definition at line 77 of file timemory.hpp.

◆ base_type [1/2]

◆ base_type [2/2]

◆ storage_type

Definition at line 66 of file declaration.hpp.

◆ this_type [1/2]

◆ this_type [2/2]

◆ value_type [1/2]

Definition at line 70 of file components.hpp.

◆ value_type [2/2]

Definition at line 389 of file timemory.hpp.

Member Function Documentation

◆ _init()

static void tim::component::caliper_common::_init ( )
inlinestaticinherited

Definition at line 79 of file timemory.hpp.

80 {
82 puts("Initializing caliper...");
83 cali_init();
84 }

References tim::debug, and tim::verbose.

Referenced by tim::component::caliper_common::init().

◆ description() [1/2]

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

Definition at line 75 of file components.hpp.

76 {
77 return "Variant of caliper_marker with support for loop marking";
78 }

◆ description() [2/2]

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

Definition at line 394 of file timemory.hpp.

395 {
396 return "Variant of caliper_marker with support for loop marking";
397 }

◆ enable_process_scope()

static void tim::component::caliper_common::enable_process_scope ( )
inlinestaticinherited

◆ enable_task_scope()

static void tim::component::caliper_common::enable_task_scope ( )
inlinestaticinherited

◆ enable_thread_scope()

static void tim::component::caliper_common::enable_thread_scope ( )
inlinestaticinherited

◆ get()

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

Definition at line 69 of file declaration.hpp.

69{}

◆ get_attributes()

static attributes_t & tim::component::caliper_common::get_attributes ( )
inlinestaticinherited

◆ get_channel()

static std::string & tim::component::caliper_common::get_channel ( )
inlinestaticinherited

Definition at line 92 of file timemory.hpp.

92{ return get_persistent_data().channel; }

◆ get_default_attributes()

static attributes_t tim::component::caliper_common::get_default_attributes ( )
inlinestaticinherited

Definition at line 96 of file timemory.hpp.

97 {
98 return (get_nested() | CALI_ATTR_SCOPE_THREAD);
99 }
static attributes_t get_nested()
Definition: timemory.hpp:101

References tim::component::caliper_common::get_nested().

◆ get_nested()

static attributes_t tim::component::caliper_common::get_nested ( )
inlinestaticinherited

◆ 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_process_scope()

static auto tim::component::caliper_common::get_process_scope ( )
inlinestaticinherited

Definition at line 106 of file timemory.hpp.

107 {
108 return attributes_t(get_nested() | CALI_ATTR_SCOPE_PROCESS);
109 }

References tim::component::caliper_common::get_nested().

Referenced by tim::component::caliper_common::enable_process_scope().

◆ get_task_scope()

static auto tim::component::caliper_common::get_task_scope ( )
inlinestaticinherited

Definition at line 116 of file timemory.hpp.

117 {
118 return attributes_t(get_nested() | CALI_ATTR_SCOPE_TASK);
119 }

References tim::component::caliper_common::get_nested().

Referenced by tim::component::caliper_common::enable_task_scope().

◆ get_thread_scope()

static auto tim::component::caliper_common::get_thread_scope ( )
inlinestaticinherited

Definition at line 111 of file timemory.hpp.

112 {
113 return attributes_t(get_nested() | CALI_ATTR_SCOPE_THREAD);
114 }

References tim::component::caliper_common::get_nested().

Referenced by tim::component::caliper_common::enable_thread_scope().

◆ init()

static void tim::component::caliper_common::init ( )
inlinestaticinherited

Definition at line 86 of file timemory.hpp.

87 {
88 static bool _ini = (_init(), true);
90 }
void consume_parameters(ArgsT &&...)
Definition: types.hpp:285

References tim::component::caliper_common::_init(), and tim::consume_parameters().

Referenced by tim::component::caliper_common::caliper_common().

◆ label() [1/2]

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

Definition at line 74 of file components.hpp.

74{ return "caliper_loop_marker"; }

◆ label() [2/2]

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

Definition at line 393 of file timemory.hpp.

393{ return "caliper_loop_marker"; }

◆ mark_begin() [1/2]

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

Definition at line 410 of file timemory.hpp.

411 {
412 DEBUG_PRINT_HERE("%s", m_prefix);
413 cali_begin_int(m_id, m_itr++);
414 }
#define DEBUG_PRINT_HERE(...)
Definition: macros.hpp:168

References DEBUG_PRINT_HERE.

◆ mark_begin() [2/2]

template<typename T , enable_if_t< std::is_integral< T >::value, int > = 0>
void tim::component::caliper_loop_marker::mark_begin ( itr)
inline

Definition at line 422 of file timemory.hpp.

423 {
424 DEBUG_PRINT_HERE("%s @ %i", m_prefix, (int) itr);
425 m_itr = itr;
426 cali_begin_int(m_id, m_itr++);
427 }

References DEBUG_PRINT_HERE.

◆ mark_end() [1/2]

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

Definition at line 415 of file timemory.hpp.

416 {
417 DEBUG_PRINT_HERE("%s", m_prefix);
418 cali_end(m_id);
419 }

References DEBUG_PRINT_HERE.

◆ mark_end() [2/2]

template<typename T , enable_if_t< std::is_integral< T >::value, int > = 0>
void tim::component::caliper_loop_marker::mark_end ( )
inline

Definition at line 430 of file timemory.hpp.

431 {
432 DEBUG_PRINT_HERE("%s @ %i", m_prefix, (int) m_itr);
433 cali_end(m_id);
434 }

References DEBUG_PRINT_HERE.

◆ record()

template<typename T , enable_if_t< std::is_integral< T >::value, int > = 0>
tim::scope::destructor tim::component::caliper_loop_marker::record ( itr)
inline

Definition at line 437 of file timemory.hpp.

438 {
439 DEBUG_PRINT_HERE("%s @ %i", m_prefix, (int) itr);
440 m_itr = itr;
441 cali_begin_int(m_id, m_itr++);
442 return tim::scope::destructor([=]() { cali_end(m_id); });
443 }
provides an object which can be returned from functions that will execute the lambda provided during ...
Definition: types.hpp:700

References DEBUG_PRINT_HERE.

◆ set_prefix()

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

Definition at line 445 of file timemory.hpp.

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

References tim::_prefix.

◆ start()

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

Definition at line 401 of file timemory.hpp.

402 {
403 DEBUG_PRINT_HERE("%s", m_prefix);
404 cali_begin_string(m_id, m_prefix);
405 m_id = cali_make_loop_iteration_attribute(m_prefix);
406 m_itr = 0;
407 }

References DEBUG_PRINT_HERE.

◆ stop()

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

Definition at line 408 of file timemory.hpp.

408{ cali_end(m_id); }

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