Vector Optimized Library of Kernels 3.3.0
Architecture-tuned implementations of math kernels
 
Loading...
Searching...
No Matches
qa_utils.cc File Reference
#include "qa_utils.h"
#include <volk/volk.h>
#include <volk/volk_malloc.h>
#include <assert.h>
#include <stdint.h>
#include <sys/time.h>
#include <sys/types.h>
#include <chrono>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <limits>
#include <map>
#include <random>
#include <vector>
#include <fmt/core.h>

Data Structures

struct  fail_info_t
 
class  volk_qa_aligned_mem_pool
 

Functions

double volk_test_get_warmup_ms ()
 
void volk_test_set_warmup_ms (double ms)
 
void volk_test_reset_warmup ()
 
template<typename T >
void random_floats (void *buf, unsigned int n, std::default_random_engine &rnd_engine)
 
void load_random_data (void *data, volk_type_t type, unsigned int n, const std::vector< float > &float_edge_cases, const std::vector< lv_32fc_t > &complex_edge_cases)
 
static std::vector< std::string > get_arch_list (volk_func_desc_t desc)
 
template<typename T >
volk_lexical_cast (const std::string &str)
 
volk_type_t volk_type_from_string (std::string name)
 
std::vector< std::string > split_signature (const std::string &protokernel_signature)
 
static void get_signatures_from_name (std::vector< volk_type_t > &inputsig, std::vector< volk_type_t > &outputsig, std::string name)
 
void run_cast_test1 (volk_fn_1arg func, std::vector< void * > &buffs, unsigned int vlen, unsigned int iter, std::string arch)
 
void run_cast_test2 (volk_fn_2arg func, std::vector< void * > &buffs, unsigned int vlen, unsigned int iter, std::string arch)
 
void run_cast_test3 (volk_fn_3arg func, std::vector< void * > &buffs, unsigned int vlen, unsigned int iter, std::string arch)
 
void run_cast_test4 (volk_fn_4arg func, std::vector< void * > &buffs, unsigned int vlen, unsigned int iter, std::string arch)
 
void run_cast_test1_s32f (volk_fn_1arg_s32f func, std::vector< void * > &buffs, float scalar, unsigned int vlen, unsigned int iter, std::string arch)
 
void run_cast_test2_s32f (volk_fn_2arg_s32f func, std::vector< void * > &buffs, float scalar, unsigned int vlen, unsigned int iter, std::string arch)
 
void run_cast_test3_s32f (volk_fn_3arg_s32f func, std::vector< void * > &buffs, float scalar, unsigned int vlen, unsigned int iter, std::string arch)
 
void run_cast_test1_s32fc (volk_fn_1arg_s32fc func, std::vector< void * > &buffs, lv_32fc_t scalar, unsigned int vlen, unsigned int iter, std::string arch)
 
void run_cast_test2_s32fc (volk_fn_2arg_s32fc func, std::vector< void * > &buffs, lv_32fc_t scalar, unsigned int vlen, unsigned int iter, std::string arch)
 
void run_cast_test3_s32fc (volk_fn_3arg_s32fc func, std::vector< void * > &buffs, lv_32fc_t scalar, unsigned int vlen, unsigned int iter, std::string arch)
 
template<class t >
bool fcompare (t *expected, t *actual, unsigned int vlen, float tol, bool absolute_mode, std::vector< unsigned int > &fail_indices, double &max_err)
 
template<class t >
bool ccompare (t *expected, t *actual, unsigned int vlen, float tol, bool absolute_mode, std::vector< unsigned int > &fail_indices, double &max_err)
 
template<class t >
bool icompare (t *expected, t *actual, unsigned int vlen, unsigned int tol, std::vector< unsigned int > &fail_indices, double &max_err)
 
void print_error_table (const std::vector< unsigned int > &fail_indices, const std::vector< void * > &inputs, const std::vector< volk_type_t > &input_sigs, void *expected, void *actual, const volk_type_t &output_sig, float tol, int max_errors=10)
 
bool run_volk_tests (volk_func_desc_t desc, void(*manual_func)(), std::string name, volk_test_params_t test_params, std::vector< volk_test_results_t > *results, std::string puppet_master_name)
 
bool run_volk_tests (volk_func_desc_t desc, void(*manual_func)(), std::string name, float tol, lv_32fc_t scalar, unsigned int vlen, unsigned int iter, std::vector< volk_test_results_t > *results, std::string puppet_master_name, bool absolute_mode, bool benchmark_mode, const std::vector< float > &float_edge_cases, const std::vector< lv_32fc_t > &complex_edge_cases)
 

Variables

static double g_warmup_ms = 2000.0
 
static bool g_warmup_done = false
 

Function Documentation

◆ ccompare()

template<class t >
bool ccompare ( t *  expected,
t *  actual,
unsigned int  vlen,
float  tol,
bool  absolute_mode,
std::vector< unsigned int > &  fail_indices,
double &  max_err 
)

◆ fcompare()

template<class t >
bool fcompare ( t *  expected,
t *  actual,
unsigned int  vlen,
float  tol,
bool  absolute_mode,
std::vector< unsigned int > &  fail_indices,
double &  max_err 
)

◆ get_arch_list()

static std::vector< std::string > get_arch_list ( volk_func_desc_t  desc)
static

◆ get_signatures_from_name()

static void get_signatures_from_name ( std::vector< volk_type_t > &  inputsig,
std::vector< volk_type_t > &  outputsig,
std::string  name 
)
static

◆ icompare()

template<class t >
bool icompare ( t *  expected,
t *  actual,
unsigned int  vlen,
unsigned int  tol,
std::vector< unsigned int > &  fail_indices,
double &  max_err 
)

◆ load_random_data()

void load_random_data ( void *  data,
volk_type_t  type,
unsigned int  n,
const std::vector< float > &  float_edge_cases,
const std::vector< lv_32fc_t > &  complex_edge_cases 
)

◆ print_error_table()

void print_error_table ( const std::vector< unsigned int > &  fail_indices,
const std::vector< void * > &  inputs,
const std::vector< volk_type_t > &  input_sigs,
void *  expected,
void *  actual,
const volk_type_t output_sig,
float  tol,
int  max_errors = 10 
)

◆ random_floats()

template<typename T >
void random_floats ( void *  buf,
unsigned int  n,
std::default_random_engine &  rnd_engine 
)

◆ run_cast_test1()

void run_cast_test1 ( volk_fn_1arg  func,
std::vector< void * > &  buffs,
unsigned int  vlen,
unsigned int  iter,
std::string  arch 
)
inline

◆ run_cast_test1_s32f()

void run_cast_test1_s32f ( volk_fn_1arg_s32f  func,
std::vector< void * > &  buffs,
float  scalar,
unsigned int  vlen,
unsigned int  iter,
std::string  arch 
)
inline

◆ run_cast_test1_s32fc()

void run_cast_test1_s32fc ( volk_fn_1arg_s32fc  func,
std::vector< void * > &  buffs,
lv_32fc_t  scalar,
unsigned int  vlen,
unsigned int  iter,
std::string  arch 
)
inline

◆ run_cast_test2()

void run_cast_test2 ( volk_fn_2arg  func,
std::vector< void * > &  buffs,
unsigned int  vlen,
unsigned int  iter,
std::string  arch 
)
inline

◆ run_cast_test2_s32f()

void run_cast_test2_s32f ( volk_fn_2arg_s32f  func,
std::vector< void * > &  buffs,
float  scalar,
unsigned int  vlen,
unsigned int  iter,
std::string  arch 
)
inline

◆ run_cast_test2_s32fc()

void run_cast_test2_s32fc ( volk_fn_2arg_s32fc  func,
std::vector< void * > &  buffs,
lv_32fc_t  scalar,
unsigned int  vlen,
unsigned int  iter,
std::string  arch 
)
inline

◆ run_cast_test3()

void run_cast_test3 ( volk_fn_3arg  func,
std::vector< void * > &  buffs,
unsigned int  vlen,
unsigned int  iter,
std::string  arch 
)
inline

◆ run_cast_test3_s32f()

void run_cast_test3_s32f ( volk_fn_3arg_s32f  func,
std::vector< void * > &  buffs,
float  scalar,
unsigned int  vlen,
unsigned int  iter,
std::string  arch 
)
inline

◆ run_cast_test3_s32fc()

void run_cast_test3_s32fc ( volk_fn_3arg_s32fc  func,
std::vector< void * > &  buffs,
lv_32fc_t  scalar,
unsigned int  vlen,
unsigned int  iter,
std::string  arch 
)
inline

◆ run_cast_test4()

void run_cast_test4 ( volk_fn_4arg  func,
std::vector< void * > &  buffs,
unsigned int  vlen,
unsigned int  iter,
std::string  arch 
)
inline

◆ run_volk_tests() [1/2]

bool run_volk_tests ( volk_func_desc_t  desc,
void(*)()  manual_func,
std::string  name,
float  tol,
lv_32fc_t  scalar,
unsigned int  vlen,
unsigned int  iter,
std::vector< volk_test_results_t > *  results,
std::string  puppet_master_name,
bool  absolute_mode,
bool  benchmark_mode,
const std::vector< float > &  float_edge_cases,
const std::vector< lv_32fc_t > &  complex_edge_cases 
)

◆ run_volk_tests() [2/2]

bool run_volk_tests ( volk_func_desc_t  desc,
void(*)()  manual_func,
std::string  name,
volk_test_params_t  test_params,
std::vector< volk_test_results_t > *  results,
std::string  puppet_master_name 
)

◆ split_signature()

std::vector< std::string > split_signature ( const std::string &  protokernel_signature)

◆ volk_lexical_cast()

template<typename T >
T volk_lexical_cast ( const std::string &  str)

◆ volk_test_get_warmup_ms()

double volk_test_get_warmup_ms ( )

◆ volk_test_reset_warmup()

void volk_test_reset_warmup ( )

◆ volk_test_set_warmup_ms()

void volk_test_set_warmup_ms ( double  ms)

◆ volk_type_from_string()

volk_type_t volk_type_from_string ( std::string  name)

Variable Documentation

◆ g_warmup_done

bool g_warmup_done = false
static

◆ g_warmup_ms

double g_warmup_ms = 2000.0
static