summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBassam Tabbara <bassam@symform.com>2016-09-13 11:11:40 -0700
committerBassam Tabbara <bassam@symform.com>2016-09-13 12:25:00 -0700
commit0690ba86a81faff99a3383b5907ddc02a317eea0 (patch)
treecbdb3947d9d86f2fa7d9cee84d3b773e1bb8f2b2
parent0e5c920fb69f2d962db1df045d1b71b9b012b902 (diff)
downloadgf-complete-0690ba86a81faff99a3383b5907ddc02a317eea0.tar.gz
Added --enable flags for debugging runtime SIMD
-rw-r--r--configure.ac8
-rwxr-xr-xtools/test_simd.sh29
2 files changed, 23 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac
index 3beea03..d696f6e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,6 +29,14 @@ AC_CHECK_FUNCS([posix_memalign],
AS_IF([test "x$found_memalign" != "xyes"], [AC_MSG_WARN([No function for aligned memory allocation found])])
+AC_ARG_ENABLE([debug-functions],
+ AS_HELP_STRING([--enable-debug-func], [Enable debugging of functions selected]))
+AS_IF([test "x$enable_debug_func" = "xyes"], [CPPFLAGS="$CPPFLAGS -DDEBUG_FUNCTIONS"])
+
+AC_ARG_ENABLE([debug-cpu],
+ AS_HELP_STRING([--enable-debug-cpu], [Enable debugging of SIMD detection]))
+AS_IF([test "x$enable_debug_cpu" = "xyes"], [CPPFLAGS="$CPPFLAGS -DDEBUG_CPU_DETECTION"])
+
AX_EXT()
AC_ARG_ENABLE([neon],
diff --git a/tools/test_simd.sh b/tools/test_simd.sh
index 6401590..e514e4f 100755
--- a/tools/test_simd.sh
+++ b/tools/test_simd.sh
@@ -6,11 +6,12 @@
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
host_cpu=`uname -p`
results=${script_dir}/test_simd.results
+nprocs=$(grep -c ^processor /proc/cpuinfo)
# runs unit tests and save the results
test_unit(){
{ ./configure && make clean && make; } || { echo "Compile FAILED" >> ${results}; return 1; }
- make check || { echo "gf_methods $i FAILED" >> ${results}; ((++failed)); }
+ make -j$nprocs check || { echo "gf_methods $i FAILED" >> ${results}; ((++failed)); }
cat tools/test-suite.log >> ${results} || true
}
@@ -19,7 +20,7 @@ test_unit(){
test_functions() {
failed=0
- { ./configure && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "Compile FAILED" >> ${results}; return 1; }
+ { ./configure --enable-debug-func && make clean && make; } || { echo "Compile FAILED" >> ${results}; return 1; }
for i in 128 64 32 16 8 4; do
{ ${script_dir}/gf_methods $i -ACD -X >> ${results}; } || { echo "gf_methods $i FAILED" >> ${results}; ((++failed)); }
done
@@ -31,7 +32,7 @@ test_functions() {
test_detection() {
failed=0
- { ./configure && make clean && make CFLAGS="-DDEBUG_CPU_DETECTION"; } || { echo "Compile FAILED" >> ${results}; return 1; }
+ { ./configure --enable-debug-cpu && make clean && make; } || { echo "Compile FAILED" >> ${results}; return 1; }
{ ${script_dir}/gf_methods 32 -ACD -L | grep '#' >> ${results}; } || { echo "gf_methods $i FAILED" >> ${results}; ((++failed)); }
return ${failed}
@@ -133,13 +134,13 @@ runtime_arm_flags() {
failed=0
echo "====NO SIMD support..." >> ${1}
- { ./configure --disable-neon && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "Compile FAILED" >> ${1}; return 1; }
+ { ./configure --disable-neon --enable-debug-func && make clean && make; } || { echo "Compile FAILED" >> ${1}; return 1; }
for i in 128 64 32 16 8 4; do
{ ${script_dir}/gf_methods $i -ACD -X >> ${1}; } || { echo "gf_methods $i FAILED" >> ${1}; ((++failed)); }
done
echo "====FULL SIMD support..." >> ${1}
- { ./configure && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "Compile FAILED" >> ${1}; return 1; }
+ { ./configure --enable-debug-func && make clean && make; } || { echo "Compile FAILED" >> ${1}; return 1; }
for i in 128 64 32 16 8 4; do
{ ${script_dir}/gf_methods $i -ACD -X >> ${1}; } || { echo "gf_methods $i FAILED" >> ${1}; ((++failed)); }
done
@@ -151,7 +152,7 @@ runtime_arm_flags() {
runtime_arm_env() {
failed=0
- { ./configure && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "Compile FAILED" >> ${1}; return 1; }
+ { ./configure --enable-debug-func && make clean && make; } || { echo "Compile FAILED" >> ${1}; return 1; }
echo "====NO SIMD support..." >> ${1}
export GF_COMPLETE_DISABLE_NEON=1
@@ -172,7 +173,7 @@ runtime_intel_flags() {
failed=0
echo "====NO SIMD support..." >> ${1}
- { ./configure --disable-sse && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "FAIL" >> ${1}; ((++failed)); }
+ { ./configure --disable-sse --enable-debug-func && make clean && make; } || { echo "FAIL" >> ${1}; ((++failed)); }
for i in 128 64 32 16 8 4; do
{ ${script_dir}/gf_methods $i -ACD -X >> ${1}; } || { echo "gf_methods $i FAILED" >> ${1}; ((++failed)); }
done
@@ -185,7 +186,7 @@ runtime_intel_flags() {
export ax_cv_have_sse41_ext=no
export ax_cv_have_sse42_ext=no
export ax_cv_have_pclmuldq_ext=no
- { ./configure && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "FAIL" >> ${1}; ((++failed)); }
+ { ./configure --enable-debug-func && make clean && make; } || { echo "FAIL" >> ${1}; ((++failed)); }
for i in 128 64 32 16 8 4; do
{ ${script_dir}/gf_methods $i -ACD -X >> ${1}; } || { echo "gf_methods $i FAILED" >> ${1}; ((++failed)); }
done
@@ -198,7 +199,7 @@ runtime_intel_flags() {
export ax_cv_have_sse41_ext=no
export ax_cv_have_sse42_ext=no
export ax_cv_have_pclmuldq_ext=no
- { ./configure && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "FAIL" >> ${1}; ((++failed)); }
+ { ./configure --enable-debug-func && make clean && make; } || { echo "FAIL" >> ${1}; ((++failed)); }
for i in 128 64 32 16 8 4; do
{ ${script_dir}/gf_methods $i -ACD -X >> ${1}; } || { echo "gf_methods $i FAILED" >> ${1}; ((++failed)); }
done
@@ -211,7 +212,7 @@ runtime_intel_flags() {
export ax_cv_have_sse41_ext=no
export ax_cv_have_sse42_ext=no
export ax_cv_have_pclmuldq_ext=no
- { ./configure && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "FAIL" >> ${1}; ((++failed)); }
+ { ./configure --enable-debug-func && make clean && make; } || { echo "FAIL" >> ${1}; ((++failed)); }
for i in 128 64 32 16 8 4; do
{ ${script_dir}/gf_methods $i -ACD -X >> ${1}; } || { echo "gf_methods $i FAILED" >> ${1}; ((++failed)); }
done
@@ -224,7 +225,7 @@ runtime_intel_flags() {
export ax_cv_have_sse41_ext=yes
export ax_cv_have_sse42_ext=no
export ax_cv_have_pclmuldq_ext=no
- { ./configure && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "FAIL" >> ${1}; ((++failed)); }
+ { ./configure --enable-debug-func && make clean && make; } || { echo "FAIL" >> ${1}; ((++failed)); }
for i in 128 64 32 16 8 4; do
{ ${script_dir}/gf_methods $i -ACD -X >> ${1}; } || { echo "gf_methods $i FAILED" >> ${1}; ((++failed)); }
done
@@ -237,13 +238,13 @@ runtime_intel_flags() {
export ax_cv_have_sse41_ext=no
export ax_cv_have_sse42_ext=yes
export ax_cv_have_pclmuldq_ext=no
- { ./configure && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "FAIL" >> ${1}; ((++failed)); }
+ { ./configure --enable-debug-func && make clean && make; } || { echo "FAIL" >> ${1}; ((++failed)); }
for i in 128 64 32 16 8 4; do
{ ${script_dir}/gf_methods $i -ACD -X >> ${1}; } || { echo "gf_methods $i FAILED" >> ${1}; ((++failed)); }
done
echo "====FULL SIMD support..." >> ${1}
- { ./configure && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "FAIL" >> ${1}; ((++failed)); }
+ { ./configure --enable-debug-func && make clean && make; } || { echo "FAIL" >> ${1}; ((++failed)); }
for i in 128 64 32 16 8 4; do
{ ${script_dir}/gf_methods $i -ACD -X >> ${1}; } || { echo "gf_methods $i FAILED" >> ${1}; ((++failed)); }
done
@@ -255,7 +256,7 @@ runtime_intel_env() {
failed=0
# compile a build with full SIMD support
- { ./configure && make clean && make CFLAGS="-DDEBUG_FUNCTIONS"; } || { echo "Compile FAILED" >> ${1}; return 1; }
+ { ./configure --enable-debug-func && make clean && make; } || { echo "Compile FAILED" >> ${1}; return 1; }
echo "====NO SIMD support..." >> ${1}
export GF_COMPLETE_DISABLE_SSE2=1