o-du/phy
Intel O-RAN/X-RAN Generated Doxygen Documentation
|
#include <cmath>
#include <fstream>
#include <numeric>
#include <unistd.h>
#include <sys/syscall.h>
#include "common.hpp"
Go to the source code of this file.
Macros | |
#define | CPU_ID 4 |
Functions | |
int | bind_to_cpu (const unsigned cpu) |
Attach current process to the selected core. More... | |
std::pair< double, double > | calculate_statistics (const std::vector< long > values) |
Calculate the mean and variance from the result of the run_benchmark. More... | |
std::vector< unsigned > | get_sequence (const unsigned number) |
For a given number return sequence of number from 0 to number - 1. More... | |
char * | read_data_to_aligned_array (const std::string &filename) |
Read binary data from the file. More... | |
json | read_json_from_file (const std::string &filename) |
Read JSON from the given file. More... | |
unsigned long | tsc_recovery () |
Measure the TSC on the machine. More... | |
unsigned long | tsc_tick () |
Return the current value of the TSC. More... | |
#define CPU_ID 4 |
Definition at line 34 of file common.cpp.
int bind_to_cpu | ( | const unsigned | cpu | ) |
Attach current process to the selected core.
[in] | cpu | Core number. |
Definition at line 47 of file common.cpp.
std::pair<double, double> calculate_statistics | ( | const std::vector< long > | values | ) |
Calculate the mean and variance from the result of the run_benchmark.
[in] | values | Vector with result values. |
Definition at line 60 of file common.cpp.
std::vector<unsigned> get_sequence | ( | const unsigned | number | ) |
For a given number return sequence of number from 0 to number - 1.
[in] | number | Positive integer value. |
Definition at line 78 of file common.cpp.
char* read_data_to_aligned_array | ( | const std::string & | filename | ) |
Read binary data from the file.
[in] | filename | name of the binary file. |
std::runtime_error | when memory cannot be allocated. |
Definition at line 86 of file common.cpp.
json read_json_from_file | ( | const std::string & | filename | ) |
Read JSON from the given file.
[in] | filename | name of the .json file. |
missing_config_file_exception | when file cannot be opened. |
Definition at line 106 of file common.cpp.
unsigned long tsc_recovery | ( | ) |
Measure the TSC on the machine.
Definition at line 119 of file common.cpp.
unsigned long tsc_tick | ( | ) |
Return the current value of the TSC.
Definition at line 162 of file common.cpp.