diff options
author | Tom Rondeau <tom@trondeau.com> | 2014-07-02 22:58:41 -0400 |
---|---|---|
committer | Tom Rondeau <tom@trondeau.com> | 2014-07-02 22:58:41 -0400 |
commit | 4ca2456b0120a6d1468665a6afd2094ad2da8998 (patch) | |
tree | 150890e9ebf87499ea661255952b3a8dc198518b | |
parent | d1c13af7d885220e8245674f789a080d95516521 (diff) |
volk: force use of generic kernel when VOLK_GENERIC env variable is defined.
cmake: insert VOLK_GENERIC into QA codes to only test generic versions of kernels. Helps control precision issues.
-rw-r--r-- | cmake/Modules/GrTest.cmake | 2 | ||||
-rw-r--r-- | volk/lib/volk_rank_archs.c | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/cmake/Modules/GrTest.cmake b/cmake/Modules/GrTest.cmake index 7b642046e6..62caab4b51 100644 --- a/cmake/Modules/GrTest.cmake +++ b/cmake/Modules/GrTest.cmake @@ -66,7 +66,7 @@ function(GR_ADD_TEST test_name) file(TO_NATIVE_PATH "${GR_TEST_LIBRARY_DIRS}" libpath) #ok to use on dir list? file(TO_NATIVE_PATH "${GR_TEST_PYTHON_DIRS}" pypath) #ok to use on dir list? - set(environs "GR_DONT_LOAD_PREFS=1" "srcdir=${srcdir}") + set(environs "VOLK_GENERIC=1" "GR_DONT_LOAD_PREFS=1" "srcdir=${srcdir}") list(APPEND environs ${GR_TEST_ENVIRONS}) #http://www.cmake.org/pipermail/cmake/2009-May/029464.html diff --git a/volk/lib/volk_rank_archs.c b/volk/lib/volk_rank_archs.c index 6ab013f269..0e98ac0709 100644 --- a/volk/lib/volk_rank_archs.c +++ b/volk/lib/volk_rank_archs.c @@ -74,6 +74,13 @@ int volk_rank_archs( prefs_loaded = 1; } + // If we've defined VOLK_GENERIC to be anything, always return the + // 'generic' kernel. Used in GR's QA code. + char *gen_env = getenv("VOLK_GENERIC"); + if(gen_env) { + return volk_get_index(impl_names, n_impls, "generic"); + } + //now look for the function name in the prefs list for(i = 0; i < n_arch_prefs; i++) { |