Statistics
| Branch: | Tag: | Revision:

root / volk / lib / qa_utils.h @ 45b4f703

History | View | Annotate | Download (1.6 kB)

1 c77bb3e7 Nick Foster
#ifndef VOLK_QA_UTILS_H
2 c77bb3e7 Nick Foster
#define VOLK_QA_UTILS_H
3 c77bb3e7 Nick Foster
4 b013372e Josh Blum
#include <cstdlib>
5 c77bb3e7 Nick Foster
#include <string>
6 e3997ada Nick Foster
#include <vector>
7 668da8bd Nick Foster
#include <volk/volk.h>
8 668da8bd Nick Foster
#include <volk/volk_common.h>
9 c77bb3e7 Nick Foster
10 be1b7d9f Nick Foster
struct volk_type_t {
11 be1b7d9f Nick Foster
    bool is_float;
12 be1b7d9f Nick Foster
    bool is_scalar;
13 be1b7d9f Nick Foster
    bool is_signed;
14 be1b7d9f Nick Foster
    bool is_complex;
15 be1b7d9f Nick Foster
    int size;
16 be1b7d9f Nick Foster
    std::string str;
17 be1b7d9f Nick Foster
};
18 be1b7d9f Nick Foster
19 be1b7d9f Nick Foster
volk_type_t volk_type_from_string(std::string);
20 be1b7d9f Nick Foster
21 c77bb3e7 Nick Foster
float uniform(void);
22 c77bb3e7 Nick Foster
void random_floats(float *buf, unsigned n);
23 c77bb3e7 Nick Foster
24 e3997ada Nick Foster
bool run_volk_tests(struct volk_func_desc, void(*)(), std::string, float, float, int, int, std::vector<std::string> *);
25 c77bb3e7 Nick Foster
26 e3997ada Nick Foster
#define VOLK_RUN_TESTS(func, tol, scalar, len, iter) BOOST_AUTO_TEST_CASE(func##_test) { BOOST_CHECK_EQUAL(run_volk_tests(func##_get_func_desc(), (void (*)())func##_manual, std::string(#func), tol, scalar, len, iter, 0), 0); }
27 e3997ada Nick Foster
#define VOLK_PROFILE(func, tol, scalar, len, iter, results) run_volk_tests(func##_get_func_desc(), (void (*)())func##_manual, std::string(#func), tol, scalar, len, iter, results)
28 be1b7d9f Nick Foster
typedef void (*volk_fn_1arg)(void *, unsigned int, const char*); //one input, operate in place
29 c77bb3e7 Nick Foster
typedef void (*volk_fn_2arg)(void *, void *, unsigned int, const char*);
30 c77bb3e7 Nick Foster
typedef void (*volk_fn_3arg)(void *, void *, void *, unsigned int, const char*);
31 c77bb3e7 Nick Foster
typedef void (*volk_fn_4arg)(void *, void *, void *, void *, unsigned int, const char*);
32 be1b7d9f Nick Foster
typedef void (*volk_fn_1arg_s32f)(void *, float, unsigned int, const char*); //one input vector, one scalar float input
33 be1b7d9f Nick Foster
typedef void (*volk_fn_2arg_s32f)(void *, void *, float, unsigned int, const char*);
34 e3600f59 Nick Foster
typedef void (*volk_fn_3arg_s32f)(void *, void *, void *, float, unsigned int, const char*);
35 c77bb3e7 Nick Foster
36 c77bb3e7 Nick Foster
#endif //VOLK_QA_UTILS_H