PX4 Firmware
PX4 Autopilot Software http://px4.io
MicroBenchMath::MicroBenchMath Class Reference
Inheritance diagram for MicroBenchMath::MicroBenchMath:
Collaboration diagram for MicroBenchMath::MicroBenchMath:

Public Member Functions

virtual bool run_tests ()
 Override to run your unit tests. More...
 
- Public Member Functions inherited from UnitTest
 UnitTest ()=default
 
virtual ~UnitTest ()=default
 
void print_results ()
 Prints results from running of unit tests. More...
 

Private Member Functions

bool time_single_precision_float ()
 
bool time_single_precision_float_trig ()
 
bool time_double_precision_float ()
 
bool time_double_precision_float_trig ()
 
bool time_8bit_integers ()
 
bool time_16bit_integers ()
 
bool time_32bit_integers ()
 
bool time_64bit_integers ()
 
void reset ()
 

Private Attributes

float f32
 
float f32_out
 
double f64
 
double f64_out
 
uint8_t i_8
 
uint8_t i_8_out
 
uint16_t i_16
 
uint16_t i_16_out
 
uint32_t i_32
 
uint32_t i_32_out
 
int64_t i_64
 
int64_t i_64_out
 
uint64_t u_64
 
uint64_t u_64_out
 

Additional Inherited Members

- Protected Member Functions inherited from UnitTest
virtual void _init (void)
 Run before each unit test. Override to provide custom behavior. More...
 
virtual void _cleanup (void)
 Run after each unit test. Override to provide custom behavior. More...
 
void _print_assert (const char *msg, const char *test, const char *file, int line)
 
void _print_compare (const char *msg, const char *v1_text, int v1, const char *v2_text, int v2, const char *file, int line)
 
- Protected Attributes inherited from UnitTest
int _tests_run {0}
 The number of individual unit tests run. More...
 
int _tests_failed {0}
 The number of unit tests which failed. More...
 
int _tests_passed {0}
 The number of unit tests which passed. More...
 
int _assertions {0}
 Total number of assertions tested by all unit tests. More...
 

Detailed Description

Definition at line 89 of file test_microbench_math.cpp.

Member Function Documentation

◆ reset()

void MicroBenchMath::MicroBenchMath::reset ( void  )
private

Definition at line 151 of file test_microbench_math.cpp.

References f(), M_PI, and MicroBenchMath::random().

Here is the call graph for this function:

◆ run_tests()

bool MicroBenchMath::MicroBenchMath::run_tests ( )
virtual

Override to run your unit tests.

Unit tests should be called using ut_run_test macro.

Returns
true: all unit tests succeeded, false: one or more unit tests failed

Implements UnitTest.

Definition at line 130 of file test_microbench_math.cpp.

References ut_run_test.

◆ time_16bit_integers()

bool MicroBenchMath::MicroBenchMath::time_16bit_integers ( )
private

Definition at line 241 of file test_microbench_math.cpp.

References PERF.

◆ time_32bit_integers()

bool MicroBenchMath::MicroBenchMath::time_32bit_integers ( )
private

Definition at line 251 of file test_microbench_math.cpp.

References PERF.

◆ time_64bit_integers()

bool MicroBenchMath::MicroBenchMath::time_64bit_integers ( )
private

Definition at line 261 of file test_microbench_math.cpp.

References PERF.

◆ time_8bit_integers()

bool MicroBenchMath::MicroBenchMath::time_8bit_integers ( )
private

Definition at line 231 of file test_microbench_math.cpp.

References PERF.

◆ time_double_precision_float()

bool MicroBenchMath::MicroBenchMath::time_double_precision_float ( )
private

Definition at line 204 of file test_microbench_math.cpp.

References PERF, and matrix::sqrt().

Here is the call graph for this function:

◆ time_double_precision_float_trig()

bool MicroBenchMath::MicroBenchMath::time_double_precision_float_trig ( )
private

Definition at line 215 of file test_microbench_math.cpp.

References matrix::acos(), matrix::asin(), matrix::atan2(), matrix::cos(), PERF, matrix::sin(), matrix::sqrt(), and matrix::tan().

Here is the call graph for this function:

◆ time_single_precision_float()

bool MicroBenchMath::MicroBenchMath::time_single_precision_float ( )
private

◆ time_single_precision_float_trig()

bool MicroBenchMath::MicroBenchMath::time_single_precision_float_trig ( )
private

Definition at line 191 of file test_microbench_math.cpp.

References f(), and PERF.

Here is the call graph for this function:

Member Data Documentation

◆ f32

float MicroBenchMath::MicroBenchMath::f32
private

Definition at line 108 of file test_microbench_math.cpp.

◆ f32_out

float MicroBenchMath::MicroBenchMath::f32_out
private

Definition at line 109 of file test_microbench_math.cpp.

◆ f64

double MicroBenchMath::MicroBenchMath::f64
private

Definition at line 111 of file test_microbench_math.cpp.

◆ f64_out

double MicroBenchMath::MicroBenchMath::f64_out
private

Definition at line 112 of file test_microbench_math.cpp.

◆ i_16

uint16_t MicroBenchMath::MicroBenchMath::i_16
private

Definition at line 117 of file test_microbench_math.cpp.

◆ i_16_out

uint16_t MicroBenchMath::MicroBenchMath::i_16_out
private

Definition at line 118 of file test_microbench_math.cpp.

◆ i_32

uint32_t MicroBenchMath::MicroBenchMath::i_32
private

Definition at line 120 of file test_microbench_math.cpp.

◆ i_32_out

uint32_t MicroBenchMath::MicroBenchMath::i_32_out
private

Definition at line 121 of file test_microbench_math.cpp.

◆ i_64

int64_t MicroBenchMath::MicroBenchMath::i_64
private

Definition at line 123 of file test_microbench_math.cpp.

◆ i_64_out

int64_t MicroBenchMath::MicroBenchMath::i_64_out
private

Definition at line 124 of file test_microbench_math.cpp.

◆ i_8

uint8_t MicroBenchMath::MicroBenchMath::i_8
private

Definition at line 114 of file test_microbench_math.cpp.

◆ i_8_out

uint8_t MicroBenchMath::MicroBenchMath::i_8_out
private

Definition at line 115 of file test_microbench_math.cpp.

◆ u_64

uint64_t MicroBenchMath::MicroBenchMath::u_64
private

Definition at line 126 of file test_microbench_math.cpp.

◆ u_64_out

uint64_t MicroBenchMath::MicroBenchMath::u_64_out
private

Definition at line 127 of file test_microbench_math.cpp.


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