diff options
author | Nathan West <nathan.west@okstate.edu> | 2014-01-28 17:40:27 -0600 |
---|---|---|
committer | Tom Rondeau <tom@trondeau.com> | 2014-03-06 11:44:24 -0500 |
commit | 9d71cfc3aa5532b0c34a79b0fc7daa2ae46bb56d (patch) | |
tree | e451b0daee422dedabd50b392f548e72683e259d /volk/lib | |
parent | 46d549fb82d238723bf3c2706ab2dc13913808ba (diff) |
volk: add regex option to profile
If the given regex does not match any substring in a kernel name
then return 0 from run_volk_tests, otherwise execute the tests.
Defaults to a regex of .* to run everything, and no regex which
also runs everything for QA.
Diffstat (limited to 'volk/lib')
-rw-r--r-- | volk/lib/qa_utils.cc | 9 | ||||
-rw-r--r-- | volk/lib/qa_utils.h | 6 |
2 files changed, 11 insertions, 4 deletions
diff --git a/volk/lib/qa_utils.cc b/volk/lib/qa_utils.cc index 8b95d7d6b0..8007fe75a6 100644 --- a/volk/lib/qa_utils.cc +++ b/volk/lib/qa_utils.cc @@ -3,6 +3,7 @@ #include <boost/foreach.hpp> #include <boost/assign/list_of.hpp> #include <boost/tokenizer.hpp> +#include <boost/xpressive/xpressive.hpp> #include <iostream> #include <vector> #include <list> @@ -322,8 +323,14 @@ bool run_volk_tests(volk_func_desc_t desc, int iter, std::vector<std::string> *best_arch_vector = 0, std::string puppet_master_name = "NULL", - bool benchmark_mode + bool benchmark_mode, + std::string kernel_regex ) { + boost::xpressive::sregex kernel_expression = boost::xpressive::sregex::compile(kernel_regex); + if( !boost::xpressive::regex_search(name, kernel_expression) ) { + // in this case we have a regex and are only looking to test one kernel + return false; + } std::cout << "RUN_VOLK_TESTS: " << name << "(" << vlen << "," << iter << ")" << std::endl; // The multiply and lv_force_cast_hf are work arounds for GNU Radio bugs 582 and 583 diff --git a/volk/lib/qa_utils.h b/volk/lib/qa_utils.h index 0ede962e41..fc1a0239eb 100644 --- a/volk/lib/qa_utils.h +++ b/volk/lib/qa_utils.h @@ -21,12 +21,12 @@ volk_type_t volk_type_from_string(std::string); float uniform(void); void random_floats(float *buf, unsigned n); -bool run_volk_tests(volk_func_desc_t, void(*)(), std::string, float, lv_32fc_t, int, int, std::vector<std::string> *, std::string, bool benchmark_mode=false); +bool run_volk_tests(volk_func_desc_t, void(*)(), std::string, float, lv_32fc_t, int, int, std::vector<std::string> *, std::string, bool benchmark_mode=false, std::string kernel_regex=""); #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, "NULL"), 0); } -#define VOLK_PROFILE(func, tol, scalar, len, iter, results, bnmode) run_volk_tests(func##_get_func_desc(), (void (*)())func##_manual, std::string(#func), tol, scalar, len, iter, results, "NULL", bnmode) -#define VOLK_PUPPET_PROFILE(func, puppet_master_func, tol, scalar, len, iter, results, bnmode) run_volk_tests(func##_get_func_desc(), (void (*)())func##_manual, std::string(#func), tol, scalar, len, iter, results, std::string(#puppet_master_func), bnmode) +#define VOLK_PROFILE(func, tol, scalar, len, iter, results, bnmode, kernel_regex) run_volk_tests(func##_get_func_desc(), (void (*)())func##_manual, std::string(#func), tol, scalar, len, iter, results, "NULL", bnmode, kernel_regex) +#define VOLK_PUPPET_PROFILE(func, puppet_master_func, tol, scalar, len, iter, results, bnmode, kernel_regex) run_volk_tests(func##_get_func_desc(), (void (*)())func##_manual, std::string(#func), tol, scalar, len, iter, results, std::string(#puppet_master_func), bnmode, kernel_regex) 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*); |