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.
|
Combines hardware counters and timers and executes the empirical roofline toolkit during application termination to estimate the peak possible performance for the machine. More...
#include "timemory/components/roofline/cpu_roofline.hpp"
Public Types | |
enum class | MODE { OP , AI } |
using | size_type = std::size_t |
using | event_type = std::vector< int > |
using | array_type = std::vector< long long > |
using | data_type = long long * |
using | value_type = std::pair< array_type, double > |
using | this_type = cpu_roofline< Types... > |
using | base_type = base< this_type, value_type > |
using | storage_type = typename base_type::storage_type |
using | record_type = std::function< value_type()> |
using | unit_type = typename trait::units< this_type >::type |
using | display_unit_type = typename trait::units< this_type >::display_type |
using | device_t = device::cpu |
using | count_type = wall_clock |
using | ratio_t = typename count_type::ratio_t |
using | types_tuple = std::tuple< Types... > |
using | ert_data_t = ert::exec_data< count_type > |
using | ert_data_ptr_t = std::shared_ptr< ert_data_t > |
template<typename Tp > | |
using | ert_config_type = ert::configuration< device_t, Tp, count_type > |
template<typename Tp > | |
using | ert_counter_type = ert::counter< device_t, Tp, count_type > |
template<typename Tp > | |
using | ert_executor_type = ert::executor< device_t, Tp, count_type > |
template<typename Tp > | |
using | ert_callback_type = ert::callback< ert_executor_type< Tp > > |
using | ert_config_t = std::tuple< ert_config_type< Types >... > |
using | ert_counter_t = std::tuple< ert_counter_type< Types >... > |
using | ert_executor_t = std::tuple< ert_executor_type< Types >... > |
using | ert_callback_t = std::tuple< ert_callback_type< Types >... > |
using | iterator = typename array_type::iterator |
using | const_iterator = typename array_type::const_iterator |
using | strvec_t = std::vector< std::string > |
using | intvec_t = std::vector< int > |
using | events_callback_t = std::function< intvec_t(const MODE &)> |
Public Member Functions | |
display_unit_type | display_unit () |
unit_type | get_unit () |
display_unit_type | get_display_unit () |
value_type | record () |
cpu_roofline () | |
~cpu_roofline ()=default | |
cpu_roofline (const cpu_roofline &rhs)=default | |
cpu_roofline (cpu_roofline &&rhs) noexcept=default | |
cpu_roofline & | operator= (const cpu_roofline &)=default |
cpu_roofline & | operator= (cpu_roofline &&) noexcept=default |
std::vector< double > | get () const |
void | start () |
void | stop () |
this_type & | operator+= (const this_type &rhs) |
this_type & | operator-= (const this_type &rhs) |
std::vector< double > | get_display () const |
template<typename Archive > | |
void | load (Archive &ar, const unsigned int) |
template<typename Archive > | |
void | save (Archive &ar, const unsigned int) const |
strvec_t | label_array () const |
strvec_t | description_array () const |
strvec_t | display_unit_array () const |
std::vector< int64_t > | unit_array () const |
Static Public Member Functions | |
static events_callback_t & | get_events_callback () |
replace this callback to add in custom HW counters More... | |
static bool & | use_predefined_enums () |
set to false to suppress adding predefined enumerations More... | |
static MODE & | event_mode () |
static ert_config_t & | get_finalizer () |
static ert_data_ptr_t | get_ert_data () |
static event_type | get_events () |
static void | configure () |
static void | global_init () |
static void | thread_init () |
static void | thread_finalize () |
template<typename Tp , typename FuncT > | |
static void | set_executor_callback (FuncT &&f) |
static void | global_finalize (storage_type *_store) |
template<typename Archive > | |
static void | extra_serialization (Archive &ar) |
static std::string | get_mode_string () |
static std::string | get_type_string () |
static unit_type | unit () |
static std::string | label () |
static std::string | description () |
static void | cleanup () |
template<typename... Args> | |
static opaque | get_opaque (Args &&...) |
Static Public Attributes | |
static const short | precision = 3 |
static const short | width = 8 |
Friends | |
struct | operation::record< this_type > |
struct | operation::start< this_type > |
struct | operation::stop< this_type > |
struct | operation::set_started< this_type > |
struct | operation::set_stopped< this_type > |
class | impl::storage< this_type, trait::uses_value_storage< this_type, value_type >::value > |
std::ostream & | operator<< (std::ostream &os, const this_type &obj) |
Combines hardware counters and timers and executes the empirical roofline toolkit during application termination to estimate the peak possible performance for the machine.
Types | Variadic list of data types for roofline analysis |
Definition at line 70 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::array_type = std::vector<long long> |
Definition at line 78 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::base_type = base<this_type, value_type> |
Definition at line 82 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::const_iterator = typename array_type::const_iterator |
Definition at line 124 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::count_type = wall_clock |
Definition at line 96 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::data_type = long long* |
Definition at line 79 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::device_t = device::cpu |
Definition at line 95 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::display_unit_type = typename trait::units<this_type>::display_type |
Definition at line 93 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::ert_callback_t = std::tuple<ert_callback_type<Types>...> |
Definition at line 117 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::ert_callback_type = ert::callback<ert_executor_type<Tp> > |
Definition at line 111 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::ert_config_t = std::tuple<ert_config_type<Types>...> |
Definition at line 114 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::ert_config_type = ert::configuration<device_t, Tp, count_type> |
Definition at line 105 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::ert_counter_t = std::tuple<ert_counter_type<Types>...> |
Definition at line 115 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::ert_counter_type = ert::counter<device_t, Tp, count_type> |
Definition at line 107 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::ert_data_ptr_t = std::shared_ptr<ert_data_t> |
Definition at line 101 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::ert_data_t = ert::exec_data<count_type> |
Definition at line 100 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::ert_executor_t = std::tuple<ert_executor_type<Types>...> |
Definition at line 116 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::ert_executor_type = ert::executor<device_t, Tp, count_type> |
Definition at line 109 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::event_type = std::vector<int> |
Definition at line 77 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::events_callback_t = std::function<intvec_t(const MODE&)> |
Definition at line 142 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::intvec_t = std::vector<int> |
Definition at line 141 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::iterator = typename array_type::iterator |
Definition at line 123 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::ratio_t = typename count_type::ratio_t |
Definition at line 97 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::record_type = std::function<value_type()> |
Definition at line 84 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::size_type = std::size_t |
Definition at line 76 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::storage_type = typename base_type::storage_type |
Definition at line 83 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::strvec_t = std::vector<std::string> |
Definition at line 140 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::this_type = cpu_roofline<Types...> |
Definition at line 81 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::types_tuple = std::tuple<Types...> |
Definition at line 98 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::unit_type = typename trait::units<this_type>::type |
Definition at line 92 of file cpu_roofline.hpp.
using tim::component::cpu_roofline< Types >::value_type = std::pair<array_type, double> |
Definition at line 80 of file cpu_roofline.hpp.
|
strong |
|
inline |
Definition at line 412 of file cpu_roofline.hpp.
References tim::component::cpu_roofline< Types >::configure().
|
default |
|
default |
|
defaultnoexcept |
|
inlinestatic |
Definition at line 662 of file cpu_roofline.hpp.
|
inlinestatic |
Definition at line 267 of file cpu_roofline.hpp.
References tim::component::papi_common::add_event(), tim::component::papi_vector::configure(), tim::debug, tim::component::cpu_roofline< Types >::get_events(), PRINT_HERE, and tim::verbose.
Referenced by tim::component::cpu_roofline< Types >::cpu_roofline(), tim::component::cpu_roofline< Types >::global_init(), and tim::component::cpu_roofline< Types >::thread_init().
|
inlinestatic |
Definition at line 396 of file cpu_roofline.hpp.
|
inline |
Definition at line 626 of file cpu_roofline.hpp.
|
inline |
Definition at line 365 of file cpu_roofline.hpp.
Referenced by tim::component::cpu_roofline< Types >::get_display_unit().
|
inline |
Definition at line 635 of file cpu_roofline.hpp.
References tim::component::base< wall_clock, int64_t >::get_display_unit().
|
inlinestatic |
Definition at line 162 of file cpu_roofline.hpp.
References tim::component::cpu_roofline< Types >::AI, tim::cpu_roofline_mode, tim::debug, tim::component::cpu_roofline< Types >::OP, tim::roofline_mode, and tim::verbose.
Referenced by tim::component::cpu_roofline< Types >::get_events(), tim::component::cpu_roofline< Types >::get_mode_string(), and tim::component::cpu_roofline< Types >::unit().
|
inlinestatic |
Definition at line 334 of file cpu_roofline.hpp.
References tim::component::cpu_roofline< Types >::get_ert_data().
|
inline |
Definition at line 429 of file cpu_roofline.hpp.
Referenced by tim::component::cpu_roofline< Types >::get_display(), and tim::component::cpu_roofline< Types >::save().
|
inline |
Definition at line 501 of file cpu_roofline.hpp.
References tim::component::cpu_roofline< Types >::get().
Referenced by tim::component::cpu_roofline< Types >::load(), and tim::component::cpu_roofline< Types >::save().
|
inline |
Definition at line 378 of file cpu_roofline.hpp.
References tim::component::cpu_roofline< Types >::display_unit().
|
inlinestatic |
Definition at line 204 of file cpu_roofline.hpp.
Referenced by tim::component::cpu_roofline< Types >::extra_serialization(), and tim::component::cpu_roofline< Types >::global_finalize().
|
inlinestatic |
Definition at line 212 of file cpu_roofline.hpp.
References tim::component::cpu_roofline< Types >::AI, tim::component::cpu_roofline< Types >::event_mode(), tim::component::cpu_roofline< Types >::get_events_callback(), tim::component::cpu_roofline< Types >::OP, and tim::component::cpu_roofline< Types >::use_predefined_enums().
Referenced by tim::component::cpu_roofline< Types >::configure().
|
inlinestatic |
replace this callback to add in custom HW counters
Definition at line 146 of file cpu_roofline.hpp.
Referenced by tim::component::cpu_roofline< Types >::get_events().
|
inlinestatic |
Definition at line 196 of file cpu_roofline.hpp.
Referenced by tim::component::cpu_roofline< Types >::global_finalize().
|
inlinestatic |
Definition at line 344 of file cpu_roofline.hpp.
References tim::component::cpu_roofline< Types >::event_mode(), and tim::component::cpu_roofline< Types >::OP.
Referenced by tim::component::cpu_roofline< Types >::label(), and tim::component::cpu_roofline< Types >::save().
|
inlinestaticinherited |
Definition at line 72 of file declaration.hpp.
|
inlinestatic |
Definition at line 351 of file cpu_roofline.hpp.
References tim::demangle(), and tim::mpl::apply< Ret >::join().
Referenced by tim::component::cpu_roofline< Types >::label(), and tim::component::cpu_roofline< Types >::save().
|
inline |
Definition at line 374 of file cpu_roofline.hpp.
References tim::component::cpu_roofline< Types >::unit().
|
inlinestatic |
Definition at line 316 of file cpu_roofline.hpp.
References tim::debug, tim::component::cpu_roofline< Types >::get_ert_data(), tim::component::cpu_roofline< Types >::get_finalizer(), tim::component::empty_storage::size(), and tim::verbose.
|
inlinestatic |
Definition at line 286 of file cpu_roofline.hpp.
References tim::component::cpu_roofline< Types >::configure(), tim::debug, PRINT_HERE, and tim::verbose.
|
inlinestatic |
Definition at line 382 of file cpu_roofline.hpp.
References tim::component::cpu_roofline< Types >::get_mode_string(), tim::component::cpu_roofline< Types >::get_type_string(), tim::roofline_type_labels, and tim::roofline_type_labels_cpu.
|
inline |
Definition at line 616 of file cpu_roofline.hpp.
Referenced by tim::component::cpu_roofline< Types >::load(), and tim::component::cpu_roofline< Types >::save().
|
inline |
Definition at line 573 of file cpu_roofline.hpp.
References tim::component::cpu_roofline< Types >::get_display(), tim::component::cpu_roofline< Types >::label_array(), and tim::component::base< cpu_roofline< Types... >, std::pair< std::vector< long long >, double > >::laps.
|
inline |
Definition at line 457 of file cpu_roofline.hpp.
|
inline |
Definition at line 470 of file cpu_roofline.hpp.
|
default |
|
defaultnoexcept |
|
inline |
Definition at line 404 of file cpu_roofline.hpp.
|
inline |
Definition at line 587 of file cpu_roofline.hpp.
References tim::component::cpu_roofline< Types >::get(), tim::component::cpu_roofline< Types >::get_display(), tim::component::cpu_roofline< Types >::get_mode_string(), tim::component::cpu_roofline< Types >::get_type_string(), tim::component::cpu_roofline< Types >::label_array(), and tim::component::base< cpu_roofline< Types... >, std::pair< std::vector< long long >, double > >::laps.
|
inlinestatic |
Definition at line 309 of file cpu_roofline.hpp.
References tim::ert::executor< DeviceT, Tp, CounterT >::get_callback().
|
inline |
Definition at line 438 of file cpu_roofline.hpp.
|
inline |
Definition at line 447 of file cpu_roofline.hpp.
|
inlinestatic |
Definition at line 304 of file cpu_roofline.hpp.
|
inlinestatic |
Definition at line 295 of file cpu_roofline.hpp.
References tim::component::cpu_roofline< Types >::configure(), tim::debug, PRINT_HERE, and tim::verbose.
|
inlinestatic |
Definition at line 358 of file cpu_roofline.hpp.
References tim::component::cpu_roofline< Types >::event_mode(), tim::component::cpu_roofline< Types >::OP, and tim::component::base< wall_clock, int64_t >::unit().
Referenced by tim::component::cpu_roofline< Types >::get_unit().
|
inline |
Definition at line 645 of file cpu_roofline.hpp.
References tim::component::base< wall_clock, int64_t >::get_unit().
|
inlinestatic |
set to false to suppress adding predefined enumerations
Definition at line 154 of file cpu_roofline.hpp.
Referenced by tim::component::cpu_roofline< Types >::get_events().
|
friend |
Definition at line 470 of file cpu_roofline.hpp.
|
friend |
Definition at line 73 of file cpu_roofline.hpp.
|
friend |
Definition at line 73 of file cpu_roofline.hpp.
|
friend |
Definition at line 73 of file cpu_roofline.hpp.
|
friend |
Definition at line 73 of file cpu_roofline.hpp.
|
friend |
Definition at line 73 of file cpu_roofline.hpp.
|
friend |
Definition at line 505 of file cpu_roofline.hpp.
|
static |
Definition at line 126 of file cpu_roofline.hpp.
|
static |
Definition at line 127 of file cpu_roofline.hpp.