timemory  3.2.1
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 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)
 

Static Public Member Functions

static std::string label ()
 
static std::string description ()
 
static std::string label ()
 
static std::string description ()
 
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]

◆ 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 379 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 384 of file timemory.hpp.

385  {
386  return "Variant of caliper_marker with support for loop marking";
387  }

◆ 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_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_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);
89  consume_parameters(_ini);
90  }
void consume_parameters(ArgsT &&...) TIMEMORY_HIDDEN
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 383 of file timemory.hpp.

383 { return "caliper_loop_marker"; }

◆ mark_begin() [1/2]

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

Definition at line 400 of file timemory.hpp.

401  {
402  DEBUG_PRINT_HERE("%s", m_prefix);
403  cali_begin_int(m_id, m_itr++);
404  }
#define DEBUG_PRINT_HERE(...)
Definition: macros.hpp:163

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 412 of file timemory.hpp.

413  {
414  DEBUG_PRINT_HERE("%s @ %i", m_prefix, (int) itr);
415  m_itr = itr;
416  cali_begin_int(m_id, m_itr++);
417  }

References DEBUG_PRINT_HERE.

◆ mark_end() [1/2]

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

Definition at line 405 of file timemory.hpp.

406  {
407  DEBUG_PRINT_HERE("%s", m_prefix);
408  cali_end(m_id);
409  }

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 420 of file timemory.hpp.

421  {
422  DEBUG_PRINT_HERE("%s @ %i", m_prefix, (int) m_itr);
423  cali_end(m_id);
424  }

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 427 of file timemory.hpp.

428  {
429  DEBUG_PRINT_HERE("%s @ %i", m_prefix, (int) itr);
430  m_itr = itr;
431  cali_begin_int(m_id, m_itr++);
432  return tim::scope::destructor([=]() { cali_end(m_id); });
433  }
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 435 of file timemory.hpp.

435 { m_prefix = _prefix; }
char const std::string & _prefix
Definition: definition.hpp:59

References tim::_prefix.

◆ start()

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

Definition at line 391 of file timemory.hpp.

392  {
393  DEBUG_PRINT_HERE("%s", m_prefix);
394  cali_begin_string(m_id, m_prefix);
395  m_id = cali_make_loop_iteration_attribute(m_prefix);
396  m_itr = 0;
397  }

References DEBUG_PRINT_HERE.

◆ stop()

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

Definition at line 398 of file timemory.hpp.

398 { cali_end(m_id); }

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