diff options
author | Ben Reynwar <ben@reynwar.net> | 2011-02-27 13:46:47 -0700 |
---|---|---|
committer | Ben Reynwar <ben@reynwar.net> | 2011-02-27 13:46:47 -0700 |
commit | c783c2f959ef53b75a279ce91ce23f68fd2566ae (patch) | |
tree | f351d567fb8b7016cf65746a4a3a28ce6193e787 /volk/lib/qa_utils.h | |
parent | 315f45c234e2fa84fc83641c8404cc5fcdb8412e (diff) | |
parent | a02bb131f68d5aa66093310c393562671e389778 (diff) |
Merge branch 'next' into constell_obj
Diffstat (limited to 'volk/lib/qa_utils.h')
-rw-r--r-- | volk/lib/qa_utils.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/volk/lib/qa_utils.h b/volk/lib/qa_utils.h new file mode 100644 index 0000000000..e2539060aa --- /dev/null +++ b/volk/lib/qa_utils.h @@ -0,0 +1,33 @@ +#ifndef VOLK_QA_UTILS_H +#define VOLK_QA_UTILS_H + +#include <stdlib.h> +#include <string> + +struct volk_type_t { + bool is_float; + bool is_scalar; + bool is_signed; + bool is_complex; + int size; + std::string str; +}; + +volk_type_t volk_type_from_string(std::string); + +float uniform(void); +void random_floats(float *buf, unsigned n); + +bool run_volk_tests(const int[], void(*)(), std::string, float, float, int, int); + +#define VOLK_RUN_TESTS(func, tol, scalar, len, iter) BOOST_CHECK_EQUAL(run_volk_tests(func##_arch_defs, (void (*)())func##_manual, std::string(#func), tol, scalar, len, iter), 0) + +typedef void (*volk_fn_1arg)(void *, unsigned int, const char*); //one input, operate in place +typedef void (*volk_fn_2arg)(void *, void *, unsigned int, const char*); +typedef void (*volk_fn_3arg)(void *, void *, void *, unsigned int, const char*); +typedef void (*volk_fn_4arg)(void *, void *, void *, void *, unsigned int, const char*); +typedef void (*volk_fn_1arg_s32f)(void *, float, unsigned int, const char*); //one input vector, one scalar float input +typedef void (*volk_fn_2arg_s32f)(void *, void *, float, unsigned int, const char*); +typedef void (*volk_fn_3arg_s32f)(void *, void *, void *, float, unsigned int, const char*); + +#endif //VOLK_QA_UTILS_H |