![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
7 #ifndef CALORECGPU_CALOGPUTIMED_H
8 #define CALORECGPU_CALOGPUTIMED_H
16 #include <GaudiKernel/IProperty.h>
56 m_measureTimes(ptr,
"MeasureTimes", false,
"Save time measurements"),
57 m_timeFileName(ptr,
"TimeFileOutput",
"times.txt",
"File to which time measurements should be saved")
75 template <
class ...
Args>
89 std::lock_guard<std::mutex> lock_guard(
m_timeMutex);
90 old_size = m_times.size();
91 m_times.resize(old_size +
times.size());
92 m_eventNumbers.push_back(event_num);
95 for (
size_t i = 0;
i <
times.size(); ++
i)
97 m_times[old_size +
i] =
times[
i];
101 template <
class ...
Args>
104 const size_t time_size = 1;
110 std::lock_guard<std::mutex> lock_guard(
m_timeMutex);
111 old_size = m_times.size();
112 m_times.resize(old_size + time_size);
113 m_eventNumbers.push_back(event_num);
119 template <
class ...
Args>
122 const size_t time_size =
sizeof...(args) + 1;
128 std::lock_guard<std::mutex> lock_guard(
m_timeMutex);
129 old_size = m_times.size();
130 m_times.resize(old_size + time_size);
131 m_eventNumbers.push_back(event_num);
145 std::vector<size_t>
indices(m_eventNumbers.size());
149 return m_eventNumbers[a] < m_eventNumbers[b];
154 out <<
"Event_Number Total " <<
header <<
"\n";
158 out << m_eventNumbers[
idx] <<
" ";
162 for (
size_t i = 0;
i < time_size; ++
i)
164 total += m_times[
idx * time_size +
i];
169 for (
size_t i = 0;
i < time_size; ++
i)
171 out << m_times[
idx * time_size +
i] <<
" ";
183 #endif //CALORECGPU_CALOGPUTIMED_H
std::pair< long int, long int > indices
void record_times_helper(size_t index, size_t t, Args &&... args) const
Gaudi::Property< std::string > m_timeFileName
File to which times should be saved.
std::vector< size_t > m_times ATLAS_THREAD_SAFE
Vector to hold execution times to be recorded if necessary.
void record_times_helper(size_t) const
Base class to provide some basic common infrastructure for timing measurements...
void record_times_helper(size_t index, size_t t) const
void print_times(const std::string &header, const size_t time_size) const
std::vector< size_t > m_eventNumbers ATLAS_THREAD_SAFE
Vector to hold the event numbers to be recorded if necessary.
void record_times(const size_t event_num, const size_t &value, Args &&... args) const
std::mutex m_timeMutex
Mutex that is locked when recording times.
void record_times(const size_t event_num, const size_t &value) const
void record_times(const size_t event_num, const std::vector< size_t > ×) const
Gaudi::Property< bool > m_measureTimes
If true, times are recorded to the file given by m_timeFileName.
Define macros for attributes used to control the static checker.