summaryrefslogtreecommitdiff
path: root/volk/lib
diff options
context:
space:
mode:
Diffstat (limited to 'volk/lib')
-rw-r--r--volk/lib/CMakeLists.txt6
-rw-r--r--volk/lib/volk_profile.cc123
-rw-r--r--volk/lib/volk_rank_archs.c15
-rw-r--r--volk/lib/volk_rank_archs.h8
4 files changed, 15 insertions, 137 deletions
diff --git a/volk/lib/CMakeLists.txt b/volk/lib/CMakeLists.txt
index 6198dc0e7..dfb1d4219 100644
--- a/volk/lib/CMakeLists.txt
+++ b/volk/lib/CMakeLists.txt
@@ -227,10 +227,4 @@ ADD_EXECUTABLE(test_all
TARGET_LINK_LIBRARIES(test_all volk ${Boost_LIBRARIES})
ADD_TEST(qa_volk_test_all test_all)
-ADD_EXECUTABLE(volk_profile
- ${CMAKE_CURRENT_SOURCE_DIR}/volk_profile.cc
- ${CMAKE_CURRENT_SOURCE_DIR}/qa_utils.cc
-)
-TARGET_LINK_LIBRARIES(volk_profile volk ${Boost_LIBRARIES})
-
ENDIF()
diff --git a/volk/lib/volk_profile.cc b/volk/lib/volk_profile.cc
deleted file mode 100644
index c4a04abf2..000000000
--- a/volk/lib/volk_profile.cc
+++ /dev/null
@@ -1,123 +0,0 @@
-#include "qa_utils.h"
-#include <volk/volk.h>
-#include <volk_rank_archs.h>
-#include <boost/test/unit_test.hpp>
-#include <vector>
-#include <boost/foreach.hpp>
-#include <iostream>
-#include <fstream>
-
-int main(int argc, char *argv[]) {
-
- std::vector<std::string> results;
- char path[512];
- get_config_path(path);
- std::string config_path(path);
-
-/*
- //VOLK_PROFILE(volk_16i_x5_add_quad_16i_x4_a16, 1e-4, 2046, 10000, &results);
- //VOLK_PROFILE(volk_16i_branch_4_state_8_a16, 1e-4, 2046, 10000, &results);
- VOLK_PROFILE(volk_16ic_s32f_deinterleave_real_32f_a16, 1e-5, 32768.0, 204600, 10000, &results);
- VOLK_PROFILE(volk_16ic_deinterleave_real_8i_a16, 0, 0, 204600, 10000, &results);
- VOLK_PROFILE(volk_16ic_deinterleave_16i_x2_a16, 0, 0, 204600, 10000, &results);
- VOLK_PROFILE(volk_16ic_s32f_deinterleave_32f_x2_a16, 1e-4, 32768.0, 204600, 1000, &results);
- VOLK_PROFILE(volk_16ic_deinterleave_real_16i_a16, 0, 0, 204600, 10000, &results);
- VOLK_PROFILE(volk_16ic_magnitude_16i_a16, 1, 0, 204600, 100, &results);
- VOLK_PROFILE(volk_16ic_s32f_magnitude_32f_a16, 1e-5, 32768.0, 204600, 1000, &results);
- VOLK_PROFILE(volk_16i_s32f_convert_32f_a16, 1e-4, 32768.0, 204600, 10000, &results);
- VOLK_PROFILE(volk_16i_s32f_convert_32f_u, 1e-4, 32768.0, 204600, 10000, &results);
- VOLK_PROFILE(volk_16i_convert_8i_a16, 0, 0, 204600, 10000, &results);
- VOLK_PROFILE(volk_16i_convert_8i_u, 0, 0, 204600, 10000, &results);
- VOLK_PROFILE(volk_16i_max_star_16i_a16, 0, 0, 204600, 10000, &results);
- VOLK_PROFILE(volk_16i_max_star_horizontal_16i_a16, 0, 0, 204600, 10000, &results);
- //VOLK_PROFILE(volk_16i_permute_and_scalar_add_a16, 1e-4, 0, 2046, 10000, &results);
- //VOLK_PROFILE(volk_16i_x4_quad_max_star_16i_a16, 1e-4, 0, 2046, 10000, &results);
- VOLK_PROFILE(volk_16u_byteswap_a16, 0, 0, 204600, 10000, &results);
- VOLK_PROFILE(volk_32f_accumulator_s32f_a16, 1e-4, 0, 204600, 10000, &results);
- VOLK_PROFILE(volk_32f_x2_add_32f_a16, 1e-4, 0, 204600, 10000, &results);
- VOLK_PROFILE(volk_32fc_32f_multiply_32fc_a16, 1e-4, 0, 204600, 1000, &results);
- VOLK_PROFILE(volk_32fc_s32f_power_32fc_a16, 1e-4, 0, 204600, 50, &results);
- VOLK_PROFILE(volk_32f_s32f_calc_spectral_noise_floor_32f_a16, 1e-4, 20.0, 204600, 1000, &results);
- VOLK_PROFILE(volk_32fc_s32f_atan2_32f_a16, 1e-4, 10.0, 204600, 100, &results);
- //VOLK_PROFILE(volk_32fc_x2_conjugate_dot_prod_32fc_a16, 1e-4, 0, 2046, 10000, &results);
- VOLK_PROFILE(volk_32fc_x2_conjugate_dot_prod_32fc_u, 1e-4, 0, 204600, 10000, &results);
- VOLK_PROFILE(volk_32fc_deinterleave_32f_x2_a16, 1e-4, 0, 204600, 1000, &results);
- VOLK_PROFILE(volk_32fc_deinterleave_64f_x2_a16, 1e-4, 0, 204600, 1000, &results);
- VOLK_PROFILE(volk_32fc_s32f_deinterleave_real_16i_a16, 0, 32768, 204600, 10000, &results);
- VOLK_PROFILE(volk_32fc_deinterleave_real_32f_a16, 1e-4, 0, 204600, 5000, &results);
- VOLK_PROFILE(volk_32fc_deinterleave_real_64f_a16, 1e-4, 0, 204600, 1000, &results);
- VOLK_PROFILE(volk_32fc_x2_dot_prod_32fc_a16, 1e-4, 0, 204600, 10000, &results);
- VOLK_PROFILE(volk_32fc_index_max_16u_a16, 0, 0, 204600, 10000, &results);
- VOLK_PROFILE(volk_32fc_s32f_magnitude_16i_a16, 1, 32768, 204600, 100, &results);
- VOLK_PROFILE(volk_32fc_magnitude_32f_a16, 1e-4, 0, 204600, 1000, &results);
- VOLK_PROFILE(volk_32fc_x2_multiply_32fc_a16, 1e-4, 0, 204600, 1000, &results);
- VOLK_PROFILE(volk_32f_s32f_convert_16i_a16, 1, 32768, 204600, 10000, &results);
- VOLK_PROFILE(volk_32f_s32f_convert_16i_u, 1, 32768, 204600, 10000, &results);
- VOLK_PROFILE(volk_32f_s32f_convert_32i_a16, 1, 2<<31, 204600, 10000, &results);
- VOLK_PROFILE(volk_32f_s32f_convert_32i_u, 1, 2<<31, 204600, 10000, &results);
- VOLK_PROFILE(volk_32f_convert_64f_a16, 1e-4, 0, 204600, 10000, &results);
- VOLK_PROFILE(volk_32f_convert_64f_u, 1e-4, 0, 204600, 10000, &results);
- VOLK_PROFILE(volk_32f_s32f_convert_8i_a16, 1, 128, 204600, 10000, &results);
- VOLK_PROFILE(volk_32f_s32f_convert_8i_u, 1, 128, 204600, 10000, &results);
- //VOLK_PROFILE(volk_32fc_s32f_x2_power_spectral_density_32f_a16, 1e-4, 2046, 10000, &results);
- VOLK_PROFILE(volk_32fc_s32f_power_spectrum_32f_a16, 1e-4, 0, 20460, 100, &results);
- VOLK_PROFILE(volk_32fc_x2_square_dist_32f_a16, 1e-4, 0, 204600, 10000, &results);
- VOLK_PROFILE(volk_32fc_x2_s32f_square_dist_scalar_mult_32f_a16, 1e-4, 10, 204600, 10000, &results);
- VOLK_PROFILE(volk_32f_x2_divide_32f_a16, 1e-4, 0, 204600, 2000, &results);
- VOLK_PROFILE(volk_32f_x2_dot_prod_32f_a16, 1e-4, 0, 204600, 5000, &results);
- VOLK_PROFILE(volk_32f_x2_dot_prod_32f_u, 1e-4, 0, 204600, 5000, &results);
- //VOLK_PROFILE(volk_32f_s32f_32f_fm_detect_32f_a16, 1e-4, 2046, 10000, &results);
- VOLK_PROFILE(volk_32f_index_max_16u_a16, 0, 0, 204600, 5000, &results);
- VOLK_PROFILE(volk_32f_x2_s32f_interleave_16ic_a16, 1, 32768, 204600, 3000, &results);
- VOLK_PROFILE(volk_32f_x2_interleave_32fc_a16, 0, 0, 204600, 5000, &results);
- VOLK_PROFILE(volk_32f_x2_max_32f_a16, 1e-4, 0, 204600, 2000, &results);
- VOLK_PROFILE(volk_32f_x2_min_32f_a16, 1e-4, 0, 204600, 2000, &results);
- VOLK_PROFILE(volk_32f_x2_multiply_32f_a16, 1e-4, 0, 204600, 10000, &results);
- VOLK_PROFILE(volk_32f_s32f_normalize_a16, 1e-4, 100, 204600, 10000, &results);
- VOLK_PROFILE(volk_32f_s32f_power_32f_a16, 1e-4, 4, 204600, 100, &results);
- VOLK_PROFILE(volk_32f_sqrt_32f_a16, 1e-4, 0, 204600, 100, &results);
- VOLK_PROFILE(volk_32f_s32f_stddev_32f_a16, 1e-4, 100, 204600, 3000, &results);
- VOLK_PROFILE(volk_32f_stddev_and_mean_32f_x2_a16, 1e-4, 0, 204600, 3000, &results);
- VOLK_PROFILE(volk_32f_x2_subtract_32f_a16, 1e-4, 0, 204600, 5000, &results);
- VOLK_PROFILE(volk_32f_x3_sum_of_poly_32f_a16, 1e-4, 0, 204600, 5000, &results);
- VOLK_PROFILE(volk_32i_x2_and_32i_a16, 0, 0, 204600, 10000, &results);
- VOLK_PROFILE(volk_32i_s32f_convert_32f_a16, 1e-4, 100, 204600, 10000, &results);
- VOLK_PROFILE(volk_32i_s32f_convert_32f_u, 1e-4, 100, 204600, 10000, &results);
- VOLK_PROFILE(volk_32i_x2_or_32i_a16, 0, 0, 204600, 10000, &results);
- VOLK_PROFILE(volk_32u_byteswap_a16, 0, 0, 204600, 2000, &results);
- //VOLK_PROFILE(volk_32u_popcnt_a16, 0, 0, 2046, 10000, &results);
- VOLK_PROFILE(volk_64f_convert_32f_a16, 1e-4, 0, 204600, 10000, &results);
- VOLK_PROFILE(volk_64f_convert_32f_u, 1e-4, 0, 204600, 10000, &results);
- VOLK_PROFILE(volk_64f_x2_max_64f_a16, 1e-4, 0, 204600, 1000, &results);
- VOLK_PROFILE(volk_64f_x2_min_64f_a16, 1e-4, 0, 204600, 1000, &results);
- VOLK_PROFILE(volk_64u_byteswap_a16, 0, 0, 204600, 1000, &results);
- //VOLK_PROFILE(volk_64u_popcnt_a16, 0, 0, 2046, 10000, &results);
- VOLK_PROFILE(volk_8ic_deinterleave_16i_x2_a16, 0, 0, 204600, 3000, &results);
- VOLK_PROFILE(volk_8ic_s32f_deinterleave_32f_x2_a16, 1e-4, 100, 204600, 3000, &results);
- VOLK_PROFILE(volk_8ic_deinterleave_real_16i_a16, 0, 256, 204600, 3000, &results);
- VOLK_PROFILE(volk_8ic_s32f_deinterleave_real_32f_a16, 1e-4, 100, 204600, 3000, &results);
- VOLK_PROFILE(volk_8ic_deinterleave_real_8i_a16, 0, 0, 204600, 10000, &results);
- VOLK_PROFILE(volk_8ic_x2_multiply_conjugate_16ic_a16, 0, 0, 204600, 400, &results);
- VOLK_PROFILE(volk_8ic_x2_s32f_multiply_conjugate_32fc_a16, 1e-4, 100, 204600, 400, &results);
- VOLK_PROFILE(volk_8i_convert_16i_a16, 0, 0, 204600, 20000, &results);
- VOLK_PROFILE(volk_8i_convert_16i_u, 0, 0, 204600, 2000, &results);
-*/
- VOLK_PROFILE(volk_8i_s32f_convert_32f_a16, 1e-4, 100, 204600, 2000, &results);
- VOLK_PROFILE(volk_8i_s32f_convert_32f_u, 1e-4, 100, 204600, 2000, &results);
-
- std::ofstream config;
- std::cout << "filename: " << config_path << std::endl;
- config.open(config_path.c_str());
-
- config << "\
-#this file is generated by volk_profile.\n\
-#the function name is followed by the preferred architecture.\n\
-";
-
- BOOST_FOREACH(std::string result, results) {
- config << result << std::endl;
- }
- config.close();
-
- load_preferences();
-}
diff --git a/volk/lib/volk_rank_archs.c b/volk/lib/volk_rank_archs.c
index f505abeb6..14f1789da 100644
--- a/volk/lib/volk_rank_archs.c
+++ b/volk/lib/volk_rank_archs.c
@@ -7,6 +7,8 @@
#include <Windows.h>
#endif
+//this should be used by the profiler app to find the path as well
+//possibly all this stuff should go in a separate volk_prefs.cc
void get_config_path(char *path) {
const char *suffix = "/.gnuradio/volk_config";
memcpy(path, getenv("HOME"), strlen(getenv("HOME"))+1);
@@ -25,8 +27,19 @@ void get_config_path(char *path) {
*
* also means you don't have to also spec the fn name in qa_utils.h/c, you can
* pass it in along with the func_desc
+ *
+ * your prefs reader should also have a prefs writer which takes a vector of prefs and writes them
+ * then your profiler can just write the prefs by passing that out
*
*/
+
+struct volk_arch_pref {
+ const char *name;
+ const char *arch;
+};
+
+//if we end up with more this will have to use realloc
+struct volk_arch_pref volk_arch_prefs[400];
void load_preferences(void) {
static int prefs_loaded = 0;
@@ -56,7 +69,7 @@ void load_preferences(void) {
prefs_loaded = 1;
}
-unsigned int volk_rank_archs(const int* arch_defs, unsigned int n_archs, unsigned int arch) {
+unsigned int volk_rank_archs(const int* arch_defs, unsigned int n_archs, const char* name, unsigned int arch) {
int i = 1;
unsigned int best_val = 0;
for(; i < n_archs; ++i) {
diff --git a/volk/lib/volk_rank_archs.h b/volk/lib/volk_rank_archs.h
index 37a0fbc46..ba248aa59 100644
--- a/volk/lib/volk_rank_archs.h
+++ b/volk/lib/volk_rank_archs.h
@@ -5,13 +5,7 @@
extern "C" {
#endif
-unsigned int volk_rank_archs(const int* arch_defs, unsigned int n_archs, unsigned int arch);
-
-////////////////////////////////////////////////////////////////////////
-//get path to volk_config profiling info
-////////////////////////////////////////////////////////////////////////
-void get_config_path(char *);
-void load_preferences(void); //FIXME DEBUG shouldn't be exported
+unsigned int volk_rank_archs(const int* arch_defs, unsigned int n_archs, const char *name, unsigned int arch);
#ifdef __cplusplus
}