o-du/phy
Intel O-RAN/X-RAN Generated Doxygen Documentation
|
#include <common.hpp>
Static Public Member Functions | |
static void | SetUpTestCase () |
static void | TearDownTestCase () |
static unsigned | get_number_of_cases (const std::string &type) |
Static Public Attributes | |
static json | conf |
static std::string | test_type |
Protected Member Functions | |
void | set_division_factor (const double factor) |
Set division factor. More... | |
void | set_results_units (const std::string &units) |
Set reults units. More... | |
void | set_parallelization_factor (const int factor) |
Set size of processed data. More... | |
template<typename F , typename ... Args> | |
void | performance (const std::string &isa, const std::string &module_name, F function, Args ... args) |
Run performance test case for a given function. More... | |
void | print_test_description (const std::string &isa, const std::string &module_name) |
Print unique test description to the results xml file. More... | |
const std::string | get_case_name () |
Get name of the test case from JSON file. More... | |
void | init_test (const std::string &type) |
Defines section in the conf.json that is used to load parameters from. More... | |
template<typename T > | |
T | get_input_parameter (const std::string ¶meter_name) |
Load selected data from a JSON object. get_input_parameter loads data from parameters section of the test case in JSON file and get_reference_parameter does the same thing for references section. More... | |
template<typename T > | |
T | get_reference_parameter (const std::string ¶meter_name) |
Protected Attributes | |
double | division_factor = 1.0 |
std::string | result_units = "None" |
int | parallelization_factor = 1 |
Each test class has to inherit from KernelTests class as it provides GTest support and does a lot of setup (including JSON) an provides useful methods to operate on loaded JSON file. Unfortunately GTest is limited in the way that all TEST_P within the class are called for all cases/parameters, but we usually want two different data sets for functional and performance tests (or maybe other types of tests). Because of that to use different data sets we need to create separate classes, hence performance and functional test are in separate classes. it adds an extra overhead, but adds much more flexibility. init_test(...) is used to select data set from the JSON file.
Important note on the JSON file structure. Top JSON object can have as many section (JSON objects) as needed, but each have to have a distinct name that is used by init_test. Then each section must contain an array of objects (test cases) where each object has a name, parameters and references. Everything inside parameters and references can be completely custom as it's loaded by get_input/reference_parameter function. JSON values can be either literal values, e.g. 1, 0.001, 5e-05, etc. or filename. Depends on the get type test framework can either read the value or load data from the file - and it happens automatically (pff MAGIC!).
Definition at line 156 of file common.hpp.
|
inlineprotected |
Get name of the test case from JSON file.
Definition at line 338 of file common.hpp.
|
inlineprotected |
Load selected data from a JSON object. get_input_parameter loads data from parameters section of the test case in JSON file and get_reference_parameter does the same thing for references section.
Get parameter function uses template type to figure out how to load parameters. If type is NOT a pointer it'll load value directly from the JSON. Otherwise path to the test vector is expected and function will allocate memory, load data from the binary file to this memory location and return pointer to it. For example in here we request to load pointer to float so llrs filed is expected to be a path to the binary file.
Definition at line 290 of file common.hpp.
|
inlinestatic |
Definition at line 190 of file common.hpp.
|
inlineprotected |
|
inlineprotected |
Defines section in the conf.json that is used to load parameters from.
[in] | type | Name of the section in the JSON file. |
Definition at line 358 of file common.hpp.
|
inlineprotected |
Run performance test case for a given function.
[in] | isa | Used Instruction Set. |
[in] | module_name | name of the tested kernel. |
[in] | function | function to be tested. |
[in] | args | function's arguments. |
Definition at line 253 of file common.hpp.
|
inlineprotected |
Print unique test description to the results xml file.
[in] | isa | Used Instruction Set. |
[in] | module_name | name of the tested kernel. |
[in] | function | function to be tested. |
Definition at line 271 of file common.hpp.
|
inlineprotected |
Set division factor.
[in] | factor | Division factor that divides mean and standard deviation. |
Definition at line 222 of file common.hpp.
|
inlineprotected |
Set size of processed data.
[in] | size | Size of processed data used to calculate module throughput. |
Definition at line 240 of file common.hpp.
|
inlineprotected |
Set reults units.
[in] | units | Units that are displayed in the report. |
Definition at line 231 of file common.hpp.
|
inlinestatic |
|
inlinestatic |
Definition at line 185 of file common.hpp.
|
static |
Definition at line 159 of file common.hpp.
|
protected |
Definition at line 214 of file common.hpp.
|
protected |
Definition at line 216 of file common.hpp.
|
protected |
Definition at line 215 of file common.hpp.
|
static |
Definition at line 160 of file common.hpp.