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::ert::exec_data< Tp > Class Template Reference

#include "timemory/ert/data.hpp"

+ Collaboration diagram for tim::ert::exec_data< Tp >:

Public Types

using value_type = std::tuple< std::string, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, Tp, std::string, std::string, exec_params >
 
using labels_type = std::array< string_t, std::tuple_size< value_type >::value >
 
using value_array = std::vector< value_type >
 
using size_type = typename value_array::size_type
 
using iterator = typename value_array::iterator
 
using const_iterator = typename value_array::const_iterator
 
using this_type = exec_data< Tp >
 

Public Member Functions

 exec_data ()=default
 
 ~exec_data ()=default
 
 exec_data (const exec_data &)=delete
 
 exec_data (exec_data &&) noexcept=default
 
exec_dataoperator= (const exec_data &)=delete
 
exec_dataoperator= (exec_data &&) noexcept=default
 
void set_labels (const labels_type &_labels)
 
labels_type get_labels () const
 
size_type size ()
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
exec_dataoperator+= (const value_type &entry)
 
exec_dataoperator+= (const exec_data &rhs)
 
template<typename Archive >
void save (Archive &ar, const unsigned int) const
 
template<typename Archive >
void load (Archive &ar, const unsigned int)
 

Friends

std::ostream & operator<< (std::ostream &os, const exec_data &obj)
 

Detailed Description

template<typename Tp>
class tim::ert::exec_data< Tp >

Definition at line 129 of file data.hpp.

Member Typedef Documentation

◆ const_iterator

template<typename Tp >
using tim::ert::exec_data< Tp >::const_iterator = typename value_array::const_iterator

Definition at line 138 of file data.hpp.

◆ iterator

template<typename Tp >
using tim::ert::exec_data< Tp >::iterator = typename value_array::iterator

Definition at line 137 of file data.hpp.

◆ labels_type

template<typename Tp >
using tim::ert::exec_data< Tp >::labels_type = std::array<string_t, std::tuple_size<value_type>::value>

Definition at line 134 of file data.hpp.

◆ size_type

template<typename Tp >
using tim::ert::exec_data< Tp >::size_type = typename value_array::size_type

Definition at line 136 of file data.hpp.

◆ this_type

template<typename Tp >
using tim::ert::exec_data< Tp >::this_type = exec_data<Tp>

Definition at line 139 of file data.hpp.

◆ value_array

template<typename Tp >
using tim::ert::exec_data< Tp >::value_array = std::vector<value_type>

Definition at line 135 of file data.hpp.

◆ value_type

template<typename Tp >
using tim::ert::exec_data< Tp >::value_type = std::tuple<std::string, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, Tp, std::string, std::string, exec_params>

Definition at line 132 of file data.hpp.

Constructor & Destructor Documentation

◆ exec_data() [1/3]

template<typename Tp >
tim::ert::exec_data< Tp >::exec_data ( )
default

◆ ~exec_data()

template<typename Tp >
tim::ert::exec_data< Tp >::~exec_data ( )
default

◆ exec_data() [2/3]

template<typename Tp >
tim::ert::exec_data< Tp >::exec_data ( const exec_data< Tp > &  )
delete

◆ exec_data() [3/3]

template<typename Tp >
tim::ert::exec_data< Tp >::exec_data ( exec_data< Tp > &&  )
defaultnoexcept

Member Function Documentation

◆ begin() [1/2]

template<typename Tp >
iterator tim::ert::exec_data< Tp >::begin ( )
inline

Definition at line 157 of file data.hpp.

157{ return m_values.begin(); }

◆ begin() [2/2]

template<typename Tp >
const_iterator tim::ert::exec_data< Tp >::begin ( ) const
inline

Definition at line 158 of file data.hpp.

158{ return m_values.begin(); }

◆ end() [1/2]

template<typename Tp >
iterator tim::ert::exec_data< Tp >::end ( )
inline

Definition at line 159 of file data.hpp.

159{ return m_values.end(); }

◆ end() [2/2]

template<typename Tp >
const_iterator tim::ert::exec_data< Tp >::end ( ) const
inline

Definition at line 160 of file data.hpp.

160{ return m_values.end(); }

◆ get_labels()

template<typename Tp >
labels_type tim::ert::exec_data< Tp >::get_labels ( ) const
inline

Definition at line 155 of file data.hpp.

155{ return m_labels; }

◆ load()

template<typename Tp >
template<typename Archive >
void tim::ert::exec_data< Tp >::load ( Archive &  ar,
const unsigned int   
)
inline

Definition at line 231 of file data.hpp.

232 {
233 constexpr auto sz = std::tuple_size<value_type>::value;
234 auto _size = 0;
235 ar(cereal::make_nvp("entries", _size));
236 m_values.resize(_size);
237
238 ar.setNextName("ert");
239 ar.startNode();
240 for(auto& itr : m_values)
241 {
242 ar.startNode();
243 _load(ar, itr, make_index_sequence<sz>{});
244 ar.finishNode();
245 }
246 ar.finishNode();
247 }

◆ operator+=() [1/2]

template<typename Tp >
exec_data & tim::ert::exec_data< Tp >::operator+= ( const exec_data< Tp > &  rhs)
inline

Definition at line 177 of file data.hpp.

178 {
179 // static std::mutex _mutex;
180 // std::unique_lock<std::mutex> _lock(_mutex);
181
182 for(const auto& itr : rhs.m_values)
183 m_values.push_back(itr);
184 return *this;
185 }

◆ operator+=() [2/2]

template<typename Tp >
exec_data & tim::ert::exec_data< Tp >::operator+= ( const value_type entry)
inline

Definition at line 165 of file data.hpp.

166 {
167 // static std::mutex _mutex;
168 // std::unique_lock<std::mutex> _lock(_mutex);
169 m_values.resize(m_values.size() + 1);
170 m_values.back() = entry;
171 // m_values.push_back(entry);
172 return *this;
173 }
data::entry entry
Definition: stream.hpp:980

◆ operator=() [1/2]

template<typename Tp >
exec_data & tim::ert::exec_data< Tp >::operator= ( const exec_data< Tp > &  )
delete

◆ operator=() [2/2]

template<typename Tp >
exec_data & tim::ert::exec_data< Tp >::operator= ( exec_data< Tp > &&  )
defaultnoexcept

◆ save()

template<typename Tp >
template<typename Archive >
void tim::ert::exec_data< Tp >::save ( Archive &  ar,
const unsigned int   
) const
inline

Definition at line 211 of file data.hpp.

212 {
213 constexpr auto sz = std::tuple_size<value_type>::value;
214 ar(cereal::make_nvp("entries", m_values.size()));
215
216 ar.setNextName("ert");
217 ar.startNode();
218 ar.makeArray();
219 for(const auto& itr : m_values)
220 {
221 ar.startNode();
222 _save(ar, itr, make_index_sequence<sz>{});
223 ar.finishNode();
224 }
225 ar.finishNode();
226 }

◆ set_labels()

template<typename Tp >
void tim::ert::exec_data< Tp >::set_labels ( const labels_type _labels)
inline

Definition at line 154 of file data.hpp.

154{ m_labels = _labels; }

◆ size()

template<typename Tp >
size_type tim::ert::exec_data< Tp >::size ( )
inline

Definition at line 156 of file data.hpp.

156{ return m_values.size(); }

Friends And Related Function Documentation

◆ operator<<

template<typename Tp >
std::ostream & operator<< ( std::ostream &  os,
const exec_data< Tp > &  obj 
)
friend

Definition at line 190 of file data.hpp.

191 {
192 std::stringstream ss;
193 for(const auto& itr : obj.m_values)
194 {
195 ss << std::setw(24) << std::get<0>(itr) << " (device: " << std::get<7>(itr)
196 << ", dtype = " << std::get<8>(itr) << "): ";
197 obj.write<1>(ss, itr, ", ", 10);
198 obj.write<2>(ss, itr, ", ", 6);
199 obj.write<3>(ss, itr, ", ", 12);
200 obj.write<4>(ss, itr, ", ", 12);
201 obj.write<5>(ss, itr, ", ", 12);
202 obj.write<6>(ss, itr, "\n", 12);
203 }
204 os << ss.str();
205 return os;
206 }
const std::string std::ostream * os

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