Commit 0690ba86a81faff99a3383b5907ddc02a317eea0

Authored by Bassam Tabbara
1 parent 0e5c920f
Exists in master and in 1 other branch v3

Added --enable flags for debugging runtime SIMD

Showing 2 changed files with 23 additions and 14 deletions   Show diff stats
configure.ac
... ... @@ -29,6 +29,14 @@ AC_CHECK_FUNCS([posix_memalign],
29 29  
30 30 AS_IF([test "x$found_memalign" != "xyes"], [AC_MSG_WARN([No function for aligned memory allocation found])])
31 31  
  32 +AC_ARG_ENABLE([debug-functions],
  33 + AS_HELP_STRING([--enable-debug-func], [Enable debugging of functions selected]))
  34 +AS_IF([test "x$enable_debug_func" = "xyes"], [CPPFLAGS="$CPPFLAGS -DDEBUG_FUNCTIONS"])
  35 +
  36 +AC_ARG_ENABLE([debug-cpu],
  37 + AS_HELP_STRING([--enable-debug-cpu], [Enable debugging of SIMD detection]))
  38 +AS_IF([test "x$enable_debug_cpu" = "xyes"], [CPPFLAGS="$CPPFLAGS -DDEBUG_CPU_DETECTION"])
  39 +
32 40 AX_EXT()
33 41  
34 42 AC_ARG_ENABLE([neon],
... ...
tools/test_simd.sh
... ... @@ -6,11 +6,12 @@
6 6 script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
7 7 host_cpu=`uname -p`
8 8 results=${script_dir}/test_simd.results
  9 +nprocs=$(grep -c ^processor /proc/cpuinfo)
9 10  
10 11 # runs unit tests and save the results
11 12 test_unit(){
12 13 { ./configure && make clean && make; } || { echo "Compile FAILED" >> ${results}; return 1; }
13   - make check || { echo "gf_methods $i FAILED" >> ${results}; ((++failed)); }
  14 + make -j$nprocs check || { echo "gf_methods $i FAILED" >> ${results}; ((++failed)); }
14 15 cat tools/test-suite.log >> ${results} || true
15 16 }
16 17  
... ... @@ -19,7 +20,7 @@ test_unit(){
19 20 test_functions() {
20 21 failed=0
21 22  
22   - { ./configure && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "Compile FAILED" >> ${results}; return 1; }
  23 + { ./configure --enable-debug-func && make clean && make; } || { echo "Compile FAILED" >> ${results}; return 1; }
23 24 for i in 128 64 32 16 8 4; do
24 25 { ${script_dir}/gf_methods $i -ACD -X >> ${results}; } || { echo "gf_methods $i FAILED" >> ${results}; ((++failed)); }
25 26 done
... ... @@ -31,7 +32,7 @@ test_functions() {
31 32 test_detection() {
32 33 failed=0
33 34  
34   - { ./configure && make clean && make CFLAGS="-DDEBUG_CPU_DETECTION"; } || { echo "Compile FAILED" >> ${results}; return 1; }
  35 + { ./configure --enable-debug-cpu && make clean && make; } || { echo "Compile FAILED" >> ${results}; return 1; }
35 36 { ${script_dir}/gf_methods 32 -ACD -L | grep '#' >> ${results}; } || { echo "gf_methods $i FAILED" >> ${results}; ((++failed)); }
36 37  
37 38 return ${failed}
... ... @@ -133,13 +134,13 @@ runtime_arm_flags() {
133 134 failed=0
134 135  
135 136 echo "====NO SIMD support..." >> ${1}
136   - { ./configure --disable-neon && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "Compile FAILED" >> ${1}; return 1; }
  137 + { ./configure --disable-neon --enable-debug-func && make clean && make; } || { echo "Compile FAILED" >> ${1}; return 1; }
137 138 for i in 128 64 32 16 8 4; do
138 139 { ${script_dir}/gf_methods $i -ACD -X >> ${1}; } || { echo "gf_methods $i FAILED" >> ${1}; ((++failed)); }
139 140 done
140 141  
141 142 echo "====FULL SIMD support..." >> ${1}
142   - { ./configure && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "Compile FAILED" >> ${1}; return 1; }
  143 + { ./configure --enable-debug-func && make clean && make; } || { echo "Compile FAILED" >> ${1}; return 1; }
143 144 for i in 128 64 32 16 8 4; do
144 145 { ${script_dir}/gf_methods $i -ACD -X >> ${1}; } || { echo "gf_methods $i FAILED" >> ${1}; ((++failed)); }
145 146 done
... ... @@ -151,7 +152,7 @@ runtime_arm_flags() {
151 152 runtime_arm_env() {
152 153 failed=0
153 154  
154   - { ./configure && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "Compile FAILED" >> ${1}; return 1; }
  155 + { ./configure --enable-debug-func && make clean && make; } || { echo "Compile FAILED" >> ${1}; return 1; }
155 156  
156 157 echo "====NO SIMD support..." >> ${1}
157 158 export GF_COMPLETE_DISABLE_NEON=1
... ... @@ -172,7 +173,7 @@ runtime_intel_flags() {
172 173 failed=0
173 174  
174 175 echo "====NO SIMD support..." >> ${1}
175   - { ./configure --disable-sse && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "FAIL" >> ${1}; ((++failed)); }
  176 + { ./configure --disable-sse --enable-debug-func && make clean && make; } || { echo "FAIL" >> ${1}; ((++failed)); }
176 177 for i in 128 64 32 16 8 4; do
177 178 { ${script_dir}/gf_methods $i -ACD -X >> ${1}; } || { echo "gf_methods $i FAILED" >> ${1}; ((++failed)); }
178 179 done
... ... @@ -185,7 +186,7 @@ runtime_intel_flags() {
185 186 export ax_cv_have_sse41_ext=no
186 187 export ax_cv_have_sse42_ext=no
187 188 export ax_cv_have_pclmuldq_ext=no
188   - { ./configure && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "FAIL" >> ${1}; ((++failed)); }
  189 + { ./configure --enable-debug-func && make clean && make; } || { echo "FAIL" >> ${1}; ((++failed)); }
189 190 for i in 128 64 32 16 8 4; do
190 191 { ${script_dir}/gf_methods $i -ACD -X >> ${1}; } || { echo "gf_methods $i FAILED" >> ${1}; ((++failed)); }
191 192 done
... ... @@ -198,7 +199,7 @@ runtime_intel_flags() {
198 199 export ax_cv_have_sse41_ext=no
199 200 export ax_cv_have_sse42_ext=no
200 201 export ax_cv_have_pclmuldq_ext=no
201   - { ./configure && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "FAIL" >> ${1}; ((++failed)); }
  202 + { ./configure --enable-debug-func && make clean && make; } || { echo "FAIL" >> ${1}; ((++failed)); }
202 203 for i in 128 64 32 16 8 4; do
203 204 { ${script_dir}/gf_methods $i -ACD -X >> ${1}; } || { echo "gf_methods $i FAILED" >> ${1}; ((++failed)); }
204 205 done
... ... @@ -211,7 +212,7 @@ runtime_intel_flags() {
211 212 export ax_cv_have_sse41_ext=no
212 213 export ax_cv_have_sse42_ext=no
213 214 export ax_cv_have_pclmuldq_ext=no
214   - { ./configure && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "FAIL" >> ${1}; ((++failed)); }
  215 + { ./configure --enable-debug-func && make clean && make; } || { echo "FAIL" >> ${1}; ((++failed)); }
215 216 for i in 128 64 32 16 8 4; do
216 217 { ${script_dir}/gf_methods $i -ACD -X >> ${1}; } || { echo "gf_methods $i FAILED" >> ${1}; ((++failed)); }
217 218 done
... ... @@ -224,7 +225,7 @@ runtime_intel_flags() {
224 225 export ax_cv_have_sse41_ext=yes
225 226 export ax_cv_have_sse42_ext=no
226 227 export ax_cv_have_pclmuldq_ext=no
227   - { ./configure && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "FAIL" >> ${1}; ((++failed)); }
  228 + { ./configure --enable-debug-func && make clean && make; } || { echo "FAIL" >> ${1}; ((++failed)); }
228 229 for i in 128 64 32 16 8 4; do
229 230 { ${script_dir}/gf_methods $i -ACD -X >> ${1}; } || { echo "gf_methods $i FAILED" >> ${1}; ((++failed)); }
230 231 done
... ... @@ -237,13 +238,13 @@ runtime_intel_flags() {
237 238 export ax_cv_have_sse41_ext=no
238 239 export ax_cv_have_sse42_ext=yes
239 240 export ax_cv_have_pclmuldq_ext=no
240   - { ./configure && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "FAIL" >> ${1}; ((++failed)); }
  241 + { ./configure --enable-debug-func && make clean && make; } || { echo "FAIL" >> ${1}; ((++failed)); }
241 242 for i in 128 64 32 16 8 4; do
242 243 { ${script_dir}/gf_methods $i -ACD -X >> ${1}; } || { echo "gf_methods $i FAILED" >> ${1}; ((++failed)); }
243 244 done
244 245  
245 246 echo "====FULL SIMD support..." >> ${1}
246   - { ./configure && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "FAIL" >> ${1}; ((++failed)); }
  247 + { ./configure --enable-debug-func && make clean && make; } || { echo "FAIL" >> ${1}; ((++failed)); }
247 248 for i in 128 64 32 16 8 4; do
248 249 { ${script_dir}/gf_methods $i -ACD -X >> ${1}; } || { echo "gf_methods $i FAILED" >> ${1}; ((++failed)); }
249 250 done
... ... @@ -255,7 +256,7 @@ runtime_intel_env() {
255 256 failed=0
256 257  
257 258 # compile a build with full SIMD support
258   - { ./configure && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "Compile FAILED" >> ${1}; return 1; }
  259 + { ./configure --enable-debug-func && make clean && make; } || { echo "Compile FAILED" >> ${1}; return 1; }
259 260  
260 261 echo "====NO SIMD support..." >> ${1}
261 262 export GF_COMPLETE_DISABLE_SSE2=1
... ...