APM:Libraries
libraries
AP_Math
benchmarks
benchmark_matrix.cpp
Go to the documentation of this file.
1
#include <AP_gbenchmark.h>
2
3
#include <
AP_Math/AP_Math.h
>
4
5
static
void
BM_MatrixMultiplication
(benchmark::State&
state
)
6
{
7
Matrix3f
m1(
Vector3f
(1.0
f
, 2.0
f
, 3.0
f
),
8
Vector3f
(4.0
f
, 5.0
f
, 6.0
f
),
9
Vector3f
(7.0
f
, 8.0
f
, 9.0
f
));
10
Matrix3f
m2(
Vector3f
(1.0
f
, 2.0
f
, 3.0
f
),
11
Vector3f
(4.0
f
, 5.0
f
, 6.0
f
),
12
Vector3f
(7.0
f
, 8.0
f
, 9.0
f
));
13
14
while
(state.KeepRunning()) {
15
Matrix3f
m3 = m1 * m2;
16
gbenchmark_escape(&m3);
17
}
18
}
19
20
BENCHMARK
(
BM_MatrixMultiplication
);
21
22
BENCHMARK_MAIN()
Vector3f
Vector3< float > Vector3f
Definition:
vector3.h:246
Matrix3< float >
BM_MatrixMultiplication
static void BM_MatrixMultiplication(benchmark::State &state)
Definition:
benchmark_matrix.cpp:5
f
#define f(i)
state
static int state
Definition:
Util.cpp:20
AP_Math.h
BENCHMARK
BENCHMARK(BM_MatrixMultiplication)
Generated on Sun Jun 17 2018 14:18:50 for APM:Libraries by
1.8.13