Ticket #1315: arm_fp.patch

File arm_fp.patch, 6.3 KB (added by carlgt1, 11 years ago)

git patch file - still need to figure out the AM_CONDITIONAL in configure.ac & client/Makefile.am for Android builds

  • android/build_boinc.sh

    From 1c22be4743efee4171cbdcb2a9ed4545d46d3ad1 Mon Sep 17 00:00:00 2001
    From: Carl Christensen <carlgt1@yahoo.com>
    Date: Tue, 27 Aug 2013 19:00:19 -0400
    Subject: [PATCH] Android/ARM Neon/VFP FP benchmarks should be working other
     than figuring out the conditional OS_ARM_LINUX in client/Makefile.am
    
    ---
     android/build_boinc.sh     |  6 +++---
     android/build_curl.sh      |  2 +-
     android/build_libraries.sh |  7 ++++---
     android/build_openssl.sh   |  2 +-
     client/Makefile.am         | 10 ++++++++++
     client/cs_benchmark.cpp    | 24 ++++++++++++++++++++++++
     client/whetstone.cpp       | 19 +++++++++++++++++++
     configure.ac               |  1 +
     8 files changed, 63 insertions(+), 8 deletions(-)
    
    diff --git a/android/build_boinc.sh b/android/build_boinc.sh
    index b442007..0eaa5b5 100755
    a b COMPILEBOINC="yes" 
    1010CONFIGURE="yes"
    1111MAKECLEAN="yes"
    1212
    13 export BOINC=".." #BOINC source code
    14 export OPENSSL_DIR=$BOINC/../boinc_depends_android_eclipse/openssl
    15 export CURL_DIR=$BOINC/../boinc_depends_android_eclipse/curl
     13export BOINC="/home/carlgt1/projects/boinc" #BOINC source code
     14export OPENSSL_DIR="/home/carlgt1/projects/extra/openssl-1.0.1e"
     15export CURL_DIR="/home/carlgt1/projects/extra/curl-7.32.0"
    1616export PKG_CONFIG_DEBUG_SPEW=1
    1717
    1818export ANDROIDTC="$HOME/android-tc"
  • android/build_curl.sh

    diff --git a/android/build_curl.sh b/android/build_curl.sh
    index 726ae28..e377c1d 100755
    a b COMPILECURL="yes" 
    1010CONFIGURE="yes"
    1111MAKECLEAN="yes"
    1212
    13 CURL="/home/boincadm/src/curl-7.28.1" #CURL sources, required by BOINC
     13export CURL="/home/carlgt1/projects/extra/curl-7.32.0"
    1414
    1515export ANDROIDTC="$HOME/android-tc"
    1616export TCBINARIES="$ANDROIDTC/bin"
  • android/build_libraries.sh

    diff --git a/android/build_libraries.sh b/android/build_libraries.sh
    index 992ef7c..7be38f1 100755
    a b COMPILEBOINC="yes" 
    1111CONFIGURE="yes"
    1212MAKECLEAN="yes"
    1313
    14 export BOINC=".." #BOINC source code
    15 export OPENSSL_DIR=$BOINC/../boinc_depends_android_eclipse/openssl
    16 export CURL_DIR=$BOINC/../boinc_depends_android_eclipse/curl
     14export BOINC="/home/carlgt1/projects/boinc"
     15export OPENSSL_DIR="/home/carlgt1/projects/extra/openssl-1.0.1e"
     16export CURL_DIR="/home/carlgt1/projects/extra/curl-7.32.0"
     17
    1718export PKG_CONFIG_DEBUG_SPEW=1
    1819
    1920export ANDROIDTC="$HOME/android-tc"
  • android/build_openssl.sh

    diff --git a/android/build_openssl.sh b/android/build_openssl.sh
    index d493e3e..0ec6e29 100755
    a b COMPILEOPENSSL="yes" 
    1010CONFIGURE="yes"
    1111MAKECLEAN="yes"
    1212
    13 OPENSSL="/home/boincadm/src/openssl-1.0.1c" #openSSL sources, requiered by BOINC
     13export OPENSSL="/home/carlgt1/projects/extra/openssl-1.0.1e"
    1414
    1515export ANDROIDTC="$HOME/android-tc"
    1616export TCBINARIES="$ANDROIDTC/bin"
  • client/Makefile.am

    diff --git a/client/Makefile.am b/client/Makefile.am
    index 0f474b8..71c6878 100644
    a b boinc_client_LDADD = $(LIBBOINC) $(LIBBOINC_CRYPT) $(BOINC_EXTRA_LIBS) $(PTHREAD 
    9595
    9696boinc_clientdir = $(bindir)
    9797
     98#if OS_ARM_LINUX
     99boinc_client_LDADD += libwhetneon.a libwhetvfp.a
     100noinst_LIBRARIES = libwhetneon.a libwhetvfp.a
     101libwhetneon_a_SOURCES = whetstone.cpp whetstone.h
     102libwhetneon_a_CXXFLAGS = $(boinc_client_CXXFLAGS) -DANDROID_NEON -mfloat-abi=softfp -mfpu=neon
     103
     104libwhetvfp_a_SOURCES = whetstone.cpp whetstone.h
     105libwhetvfp_a_CXXFLAGS = $(boinc_client_CXXFLAGS) -DANDROID_VFP -mfloat-abi=softfp -mfpu=vfp
     106#endif
     107
    98108switcher_SOURCES = switcher.cpp
    99109switcher_LDFLAGS = $(AM_LDFLAGS) -L../lib
    100110switcher_LDADD = $(LIBBOINC)
  • client/cs_benchmark.cpp

    diff --git a/client/cs_benchmark.cpp b/client/cs_benchmark.cpp
    index e41302f..a3371fa 100644
    a b  
    6060#include "filesys.h"
    6161#include "util.h"
    6262#include "cpu_benchmark.h"
     63
     64// CMC HERE - header file for whetstone namespaces (neon & vfp)
     65#ifdef ANDROID
     66#include "whetstone.h"
     67#endif
     68
    6369#include "client_msgs.h"
    6470#include "log_flags.h"
    6571#include "client_state.h"
    int cpu_benchmarks(BENCHMARK_DESC* bdp) { 
    171177
    172178    bdp->error_str[0] = '\0';
    173179    host_info.clear_host_info();
     180// CMC here
     181#ifdef ANDROID
     182  // check for vfp or neon process or no special fp process
     183  // namespaces separate the different compilations of the same whetstone.cpp file
     184    if ( strstr(gstate.host_info.p_features, " neon ") != NULL ) {
     185      // have ARM neon FP capabilities
     186      retval = android_neon::whetstone(host_info.p_fpops, fp_time, MIN_CPU_TIME);
     187    }
     188    else if ( strstr(gstate.host_info.p_features, " vfp ") != NULL ) {
     189      // have ARM vfp FP capabilities
     190      retval = android_vfp::whetstone(host_info.p_fpops, fp_time, MIN_CPU_TIME);
     191    }
     192    else { // just run normal test
     193      retval = whetstone(host_info.p_fpops, fp_time, MIN_CPU_TIME);
     194    }
     195#else
    174196    retval = whetstone(host_info.p_fpops, fp_time, MIN_CPU_TIME);
     197#endif
     198// CMC end
    175199    if (retval) {
    176200        bdp->error = true;
    177201        sprintf(bdp->error_str, "FP benchmark ran only %f sec; ignoring", fp_time);
  • client/whetstone.cpp

    diff --git a/client/whetstone.cpp b/client/whetstone.cpp
    index 0aec5d1..666364c 100644
    a b  
    3434#endif
    3535
    3636#include "util.h"
     37// CMC android
     38#ifdef ANDROID
     39#include "whetstone.h"
     40#endif
    3741#include "cpu_benchmark.h"
    3842
     43#ifndef SPDP
    3944#define SPDP double
     45#endif
     46
     47#ifdef ANDROID
     48#ifdef ANDROID_NEON
     49    namespace android_neon {
     50#else
     51  #ifdef ANDROID_VFP
     52    namespace android_vfp {
     53  #endif
     54#endif
     55#endif
    4056
    4157// External array; store results here so that optimizing compilers
    4258// don't do away with their computation.
    int whetstone(double& flops, double& cpu_time, double min_cpu_time) { 
    278294    return 0;
    279295}
    280296
     297#if defined(ANDROID_NEON) || defined(ANDROID_VFP)
     298  }
     299#endif // namespace closure
  • configure.ac

    diff --git a/configure.ac b/configure.ac
    index 2823dc3..988f5ff 100644
    a b dnl In case anyone wants to try building the windows code using mingw! 
    779779AM_CONDITIONAL(OS_WIN32_MINGW, [echo $host_os | grep '^mingw' > /dev/null])
    780780dnl or OS2
    781781AM_CONDITIONAL(OS_OS2, [echo $host_os | grep '^os2' > /dev/null])
     782AM_CONDITIONAL(OS_ARM_LINUX, [echo $host_os | grep '^arm-linux' > /dev/null])
    782783
    783784dnl Whether to build fcgi components
    784785AM_CONDITIONAL(ENABLE_FCGI,[test "${enable_fcgi}" = yes])