batmat
0.0.16
Batched linear algebra routines
Loading...
Searching...
No Matches
timing.cpp
Go to the documentation of this file.
1
#include <
batmat/timing.hpp
>
2
#include <iomanip>
3
4
#if !BATMAT_WITH_CPU_TIME
5
6
namespace
batmat
{
7
8
std::ostream &
operator<<
(std::ostream &os,
DefaultTimings
t) {
9
using
millis_f64 = std::chrono::duration<double, std::milli>;
10
auto
wall_ms = millis_f64(t.
wall_time
).count();
11
auto
prec = os.precision(6);
12
os << std::setw(8) << wall_ms <<
" ms (wall) ─ "
//
13
<< std::setw(8) <<
"?"
<<
" ms (CPU) ─ "
//
14
<< std::setprecision(5) << std::setw(7) <<
"?"
<<
"% ─ "
//
15
<< std::setw(8) << t.
num_invocations
<<
" calls"
;
//
16
os.precision(prec);
17
return
os;
18
}
19
20
}
// namespace batmat
21
22
#endif
batmat
Definition
dtypes.hpp:9
batmat::operator<<
std::ostream & operator<<(std::ostream &, DefaultTimings)
Definition
timing.cpp:8
batmat::DefaultTimings::wall_time
std::chrono::nanoseconds wall_time
Definition
timing.hpp:22
batmat::DefaultTimings::num_invocations
int64_t num_invocations
Definition
timing.hpp:21
batmat::DefaultTimings
Measures the number of invocations of a specific piece of code and its run time.
Definition
timing.hpp:20
timing.hpp
batmat
src
timing.cpp
Generated on
for batmat by
1.16.1