root / volk / lib / qa_utils.h @ be1b7d9f
History | View | Annotate | Download (1.1 kB)
| 1 | #ifndef VOLK_QA_UTILS_H
|
|---|---|
| 2 | #define VOLK_QA_UTILS_H
|
| 3 | |
| 4 | #include <stdlib.h> |
| 5 | #include <string> |
| 6 | |
| 7 | struct volk_type_t {
|
| 8 | bool is_float;
|
| 9 | bool is_scalar;
|
| 10 | bool is_signed;
|
| 11 | bool is_complex;
|
| 12 | int size;
|
| 13 | std::string str; |
| 14 | }; |
| 15 | |
| 16 | volk_type_t volk_type_from_string(std::string); |
| 17 | |
| 18 | float uniform(void); |
| 19 | void random_floats(float *buf, unsigned n); |
| 20 | |
| 21 | bool run_volk_tests(const int[], void(*)(), std::string, float, int, int); |
| 22 | |
| 23 | #define VOLK_RUN_TESTS(func, tol, len, iter) BOOST_CHECK_EQUAL(run_volk_tests(func##_arch_defs, (void (*)())func##_manual, std::string(#func), tol, len, iter), 0) |
| 24 | |
| 25 | typedef void (*volk_fn_1arg)(void *, unsigned int, const char*); //one input, operate in place |
| 26 | typedef void (*volk_fn_2arg)(void *, void *, unsigned int, const char*); |
| 27 | typedef void (*volk_fn_3arg)(void *, void *, void *, unsigned int, const char*); |
| 28 | typedef void (*volk_fn_4arg)(void *, void *, void *, void *, unsigned int, const char*); |
| 29 | typedef void (*volk_fn_1arg_s32f)(void *, float, unsigned int, const char*); //one input vector, one scalar float input |
| 30 | typedef void (*volk_fn_2arg_s32f)(void *, void *, float, unsigned int, const char*); |
| 31 | |
| 32 | #endif //VOLK_QA_UTILS_H |