From 51e173d5950aa9434438e9a31dc9dc73d78c288e Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 27 Aug 2013 21:25:04 -0700 Subject: [PATCH] Client (Android): move whetstone.h into cpu_benchmark.h --- client/Makefile.am | 4 ++-- client/cpu_benchmark.h | 19 +++++++++++++++++++ client/cs_benchmark.cpp | 6 ------ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/client/Makefile.am b/client/Makefile.am index df8994d643..59d1ff0fbe 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -98,10 +98,10 @@ boinc_clientdir = $(bindir) if OS_ARM_LINUX boinc_client_LDADD += libwhetneon.a libwhetvfp.a noinst_LIBRARIES = libwhetneon.a libwhetvfp.a -libwhetneon_a_SOURCES = whetstone.cpp whetstone.h +libwhetneon_a_SOURCES = whetstone.cpp libwhetneon_a_CXXFLAGS = $(boinc_client_CXXFLAGS) -DANDROID_NEON -mfloat-abi=softfp -mfpu=neon -libwhetvfp_a_SOURCES = whetstone.cpp whetstone.h +libwhetvfp_a_SOURCES = whetstone.cpp libwhetvfp_a_CXXFLAGS = $(boinc_client_CXXFLAGS) -DANDROID_VFP -mfloat-abi=softfp -mfpu=vfp endif diff --git a/client/cpu_benchmark.h b/client/cpu_benchmark.h index 5bcbaeed3a..f20c182bed 100644 --- a/client/cpu_benchmark.h +++ b/client/cpu_benchmark.h @@ -28,3 +28,22 @@ extern int dhrystone(double& vax_mips, double& loops, double& cpu_time, double m extern int whetstone(double& flops, double& cpu_time, double min_cpu_time); extern void benchmark_wait_to_start(int which); extern bool benchmark_time_to_stop(int which); + +// separate different compilations of whetstone.cpp which will utilize +// various ARM fp features ie neon, vfp, or "normal" +#ifdef ANDROID +#ifdef ANDROID_NEON +// add CXXFLAGS/CFLAGS for gcc: -DANDROID_NEON -mfloat-abi=softfp -mfpu=neon +#include +#endif // ANDROID_NEON + +namespace android_neon { + int whetstone(double& flops, double& cpu_time, double min_cpu_time); +} + +namespace android_vfp { + int whetstone(double& flops, double& cpu_time, double min_cpu_time); +} + +#endif // ANDROID + diff --git a/client/cs_benchmark.cpp b/client/cs_benchmark.cpp index a3371fa41f..db4dda393f 100644 --- a/client/cs_benchmark.cpp +++ b/client/cs_benchmark.cpp @@ -46,7 +46,6 @@ #endif #include #if HAVE_SYS_SIGNAL_H -#include #endif #include @@ -61,11 +60,6 @@ #include "util.h" #include "cpu_benchmark.h" -// CMC HERE - header file for whetstone namespaces (neon & vfp) -#ifdef ANDROID -#include "whetstone.h" -#endif - #include "client_msgs.h" #include "log_flags.h" #include "client_state.h"