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.
|
#include "timemory/ert/counter.hpp"
Public Types | |
using | mutex_t = std::recursive_mutex |
using | lock_t = std::unique_lock< mutex_t > |
using | counter_type = Counter |
using | ert_data_t = exec_data< Counter > |
using | this_type = counter< DeviceT, Tp, Counter > |
using | callback_type = std::function< void(uint64_t, this_type &)> |
using | data_type = typename ert_data_t::value_type |
using | data_ptr_t = std::shared_ptr< ert_data_t > |
using | ull = unsigned long long |
using | skip_ops_t = std::unordered_set< size_t > |
Public Member Functions | |
counter ()=default | |
~counter ()=default | |
counter (const counter &)=default | |
counter (counter &&) noexcept=default | |
counter & | operator= (const counter &)=default |
counter & | operator= (counter &&) noexcept=default |
counter (const exec_params &_params, data_ptr_t _exec_data, uint64_t _align=8 *sizeof(Tp)) | |
counter (const exec_params &_params, callback_type _func, data_ptr_t _exec_data, uint64_t _align=8 *sizeof(Tp)) | |
template<typename Up = Tp, typename Dev = DeviceT, typename std::enable_if<(std::is_same< Dev, device::cpu >::value||(std::is_same< Dev, device::gpu >::value &&!std::is_same< Up, gpu::fp16_t >::value)), int >::type = 0> | |
Up * | get_buffer () |
allocate a buffer for the ERT calculation uses this function if device is CPU or device is GPU and type is not half2 More... | |
template<typename Up = Tp, typename Dev = DeviceT, typename std::enable_if<(std::is_same< Up, gpu::fp16_t >::value &&std::is_same< Dev, device::gpu >::value), int >::type = 0> | |
Up * | get_buffer () |
allocate a buffer for the ERT calculation uses this function if device is GPU and type is half2 More... | |
void | destroy_buffer (Tp *buffer) |
void | configure (uint64_t tid) |
counter_type | get_counter () const |
void | record (counter_type &_counter, int n, int trials, uint64_t nops, const exec_params &_itrp) |
template<typename FuncT > | |
void | set_callback (FuncT &&_f) |
template<typename Archive > | |
void | serialize (Archive &ar, const unsigned int) |
data_ptr_t & | get_data () |
const data_ptr_t & | get_data () const |
void | add_skip_ops (size_t _Nops) |
void | add_skip_ops (std::initializer_list< size_t > _args) |
bool | skip (size_t _Nops) |
Public Attributes | |
exec_params | params = exec_params() |
int | bytes_per_element = 0 |
int | memory_accesses_per_element = 0 |
uint64_t | align = sizeof(Tp) |
uint64_t | nsize = 0 |
data_ptr_t | data = std::make_shared<ert_data_t>() |
std::string | label = "" |
skip_ops_t | skip_ops = skip_ops_t() |
Friends | |
std::ostream & | operator<< (std::ostream &os, const counter &obj) |
Definition at line 73 of file counter.hpp.
using tim::ert::counter< DeviceT, Tp, Counter >::callback_type = std::function<void(uint64_t, this_type&)> |
Definition at line 81 of file counter.hpp.
using tim::ert::counter< DeviceT, Tp, Counter >::counter_type = Counter |
Definition at line 78 of file counter.hpp.
using tim::ert::counter< DeviceT, Tp, Counter >::data_ptr_t = std::shared_ptr<ert_data_t> |
Definition at line 83 of file counter.hpp.
using tim::ert::counter< DeviceT, Tp, Counter >::data_type = typename ert_data_t::value_type |
Definition at line 82 of file counter.hpp.
using tim::ert::counter< DeviceT, Tp, Counter >::ert_data_t = exec_data<Counter> |
Definition at line 79 of file counter.hpp.
using tim::ert::counter< DeviceT, Tp, Counter >::lock_t = std::unique_lock<mutex_t> |
Definition at line 77 of file counter.hpp.
using tim::ert::counter< DeviceT, Tp, Counter >::mutex_t = std::recursive_mutex |
Definition at line 76 of file counter.hpp.
using tim::ert::counter< DeviceT, Tp, Counter >::skip_ops_t = std::unordered_set<size_t> |
Definition at line 85 of file counter.hpp.
using tim::ert::counter< DeviceT, Tp, Counter >::this_type = counter<DeviceT, Tp, Counter> |
Definition at line 80 of file counter.hpp.
using tim::ert::counter< DeviceT, Tp, Counter >::ull = unsigned long long |
Definition at line 84 of file counter.hpp.
|
default |
|
default |
|
default |
|
defaultnoexcept |
|
inlineexplicit |
Definition at line 101 of file counter.hpp.
|
inline |
Definition at line 113 of file counter.hpp.
|
inline |
Definition at line 280 of file counter.hpp.
References tim::ert::counter< DeviceT, Tp, Counter >::skip_ops.
Referenced by tim::ert::configuration< DeviceT, Tp, CounterT >::get_executor().
|
inline |
Definition at line 282 of file counter.hpp.
References tim::_args, and tim::ert::counter< DeviceT, Tp, Counter >::skip_ops.
|
inline |
Definition at line 184 of file counter.hpp.
Referenced by tim::ert::ops_main().
|
inline |
Definition at line 178 of file counter.hpp.
Referenced by tim::ert::ops_main().
|
inline |
allocate a buffer for the ERT calculation uses this function if device is CPU or device is GPU and type is not half2
Definition at line 133 of file counter.hpp.
References tim::ert::counter< DeviceT, Tp, Counter >::align, tim::debug, and tim::ert::counter< DeviceT, Tp, Counter >::nsize.
Referenced by tim::ert::ops_main().
|
inline |
allocate a buffer for the ERT calculation uses this function if device is GPU and type is half2
Definition at line 158 of file counter.hpp.
References tim::ert::counter< DeviceT, Tp, Counter >::align, tim::debug, and tim::ert::counter< DeviceT, Tp, Counter >::nsize.
|
inline |
|
inline |
Definition at line 274 of file counter.hpp.
References tim::ert::counter< DeviceT, Tp, Counter >::data.
|
inline |
Definition at line 275 of file counter.hpp.
References tim::ert::counter< DeviceT, Tp, Counter >::data.
|
default |
|
defaultnoexcept |
|
inline |
Definition at line 196 of file counter.hpp.
References tim::ert::counter< DeviceT, Tp, Counter >::bytes_per_element, tim::ert::counter< DeviceT, Tp, Counter >::data, tim::ert::counter< DeviceT, Tp, Counter >::label, tim::ert::counter< DeviceT, Tp, Counter >::memory_accesses_per_element, tim::ert::exec_params::nproc, tim::ert::exec_params::nthreads, and tim::ert::counter< DeviceT, Tp, Counter >::params.
Referenced by tim::ert::ops_main().
|
inline |
Definition at line 247 of file counter.hpp.
References tim::ert::counter< DeviceT, Tp, Counter >::data, and tim::ert::counter< DeviceT, Tp, Counter >::params.
|
inline |
Definition at line 238 of file counter.hpp.
|
inline |
Definition at line 288 of file counter.hpp.
References tim::ert::counter< DeviceT, Tp, Counter >::skip_ops.
Referenced by tim::ert::ops_main().
|
friend |
Definition at line 257 of file counter.hpp.
uint64_t tim::ert::counter< DeviceT, Tp, Counter >::align = sizeof(Tp) |
Definition at line 297 of file counter.hpp.
Referenced by tim::ert::counter< DeviceT, Tp, Counter >::get_buffer().
int tim::ert::counter< DeviceT, Tp, Counter >::bytes_per_element = 0 |
Definition at line 295 of file counter.hpp.
Referenced by tim::ert::executor< DeviceT, Tp, CounterT >::execute(), tim::ert::executor< device::gpu, Tp, CounterT >::execute(), tim::ert::executor< device::gpu, Tp, CounterT >::execute_impl(), tim::ert::configuration< DeviceT, Tp, CounterT >::get_executor(), tim::ert::ops_main(), and tim::ert::counter< DeviceT, Tp, Counter >::record().
data_ptr_t tim::ert::counter< DeviceT, Tp, Counter >::data = std::make_shared<ert_data_t>() |
Definition at line 299 of file counter.hpp.
Referenced by tim::ert::counter< DeviceT, Tp, Counter >::get_data(), tim::ert::counter< DeviceT, Tp, Counter >::record(), and tim::ert::counter< DeviceT, Tp, Counter >::serialize().
std::string tim::ert::counter< DeviceT, Tp, Counter >::label = "" |
int tim::ert::counter< DeviceT, Tp, Counter >::memory_accesses_per_element = 0 |
Definition at line 296 of file counter.hpp.
Referenced by tim::ert::executor< DeviceT, Tp, CounterT >::execute(), tim::ert::executor< device::gpu, Tp, CounterT >::execute(), tim::ert::executor< device::gpu, Tp, CounterT >::execute_impl(), tim::ert::configuration< DeviceT, Tp, CounterT >::get_executor(), tim::ert::ops_main(), and tim::ert::counter< DeviceT, Tp, Counter >::record().
uint64_t tim::ert::counter< DeviceT, Tp, Counter >::nsize = 0 |
Definition at line 298 of file counter.hpp.
Referenced by tim::ert::counter< DeviceT, Tp, Counter >::get_buffer(), and tim::ert::ops_main().
exec_params tim::ert::counter< DeviceT, Tp, Counter >::params = exec_params() |
Definition at line 294 of file counter.hpp.
Referenced by tim::ert::ops_main(), tim::ert::counter< DeviceT, Tp, Counter >::record(), and tim::ert::counter< DeviceT, Tp, Counter >::serialize().
skip_ops_t tim::ert::counter< DeviceT, Tp, Counter >::skip_ops = skip_ops_t() |
Definition at line 301 of file counter.hpp.
Referenced by tim::ert::counter< DeviceT, Tp, Counter >::add_skip_ops(), and tim::ert::counter< DeviceT, Tp, Counter >::skip().