Skip to content

Commit

Permalink
Add armv7 test
Browse files Browse the repository at this point in the history
  • Loading branch information
daquexian committed May 29, 2019
1 parent de3f85f commit 94dab18
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 23 deletions.
11 changes: 11 additions & 0 deletions ci/build_dabnn_v7.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#! /usr/bin/env bash
set -e

echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install 'ndk-bundle'
nproc=$(ci/get_cores.sh)

mkdir build_dabnn && cd build_dabnn
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-21 -DANDROID_ABI="armeabi-v7a with NEON" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release ..
cmake --build . -- -j$nproc
cd -

54 changes: 31 additions & 23 deletions ci/dabnn_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,34 @@ pr:
- README.md
- docs/*

pool:
vmImage: 'macOS-10.14'
steps:
- checkout: self
submodules: true
- bash: brew install watch gnu-sed
displayName: Install watch and gnu-sed
- bash: ci/build_dabnn.sh
displayName: Build
- bash: ci/start_android_emulator.sh
displayName: Start Android Emulator
- bash: ci/adb_push_and_run.sh build_dabnn/tests/bconv_test
displayName: Binary Conv Test
- bash: ci/adb_push_and_run.sh build_dabnn/tests/bgemm_test
displayName: Binary Gemm Test
- bash: ci/download_models.sh
displayName: Download Models
- bash: ci/adb_push_and_run.sh build_dabnn/tests/net_test
displayName: Model Test
- bash: ci/build_aar.sh
env:
BINTRAY_KEY: $(bintrayKey)
displayName: Build and Publish AAR package
jobs:
- job: aarch64
pool:
vmImage: 'macOS-10.14'
steps:
- checkout: self
submodules: true
- bash: brew install watch gnu-sed
displayName: Install watch and gnu-sed
- bash: ci/build_dabnn.sh
displayName: Build
- bash: ci/start_android_emulator.sh
displayName: Start Android Emulator
- template: template_dabnn_run_test.yml
- bash: ci/build_aar.sh
env:
BINTRAY_KEY: $(bintrayKey)
displayName: Build and Publish AAR package
- job: armv7a_with_NEON
pool:
vmImage: 'macOS-10.14'
steps:
- checkout: self
submodules: true
- bash: brew install watch gnu-sed
displayName: Install watch and gnu-sed
- bash: ci/build_dabnn_v7.sh
displayName: Build
- bash: ci/start_android_emulator_v7.sh
displayName: Start Android Emulator
- template: template_dabnn_run_test.yml
25 changes: 25 additions & 0 deletions ci/start_android_emulator_v7.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#! /usr/bin/env bash
set -e

export TERM=xterm

echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-25;google_apis;armeabi-v7a'

echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n android_emulator -k 'system-images;android-25;google_apis;armeabi-v7a' --force

echo "Starting emulator"

# Start emulator in background
nohup $ANDROID_HOME/emulator/emulator -avd android_emulator -no-snapshot -no-audio &

# start server in advance, so that the result of watch will only change when device gets online
$ANDROID_HOME/platform-tools/adb start-server

watch -g -n 1 '$ANDROID_HOME/platform-tools/adb devices | grep -c device$'

echo "Emulator is online"

$ANDROID_HOME/platform-tools/adb devices

echo "Emulator started"

9 changes: 9 additions & 0 deletions ci/template_dabnn_run_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
steps:
- bash: ci/adb_push_and_run.sh build_dabnn/tests/bconv_test
displayName: Binary Conv Test
- bash: ci/adb_push_and_run.sh build_dabnn/tests/bgemm_test
displayName: Binary Gemm Test
- bash: ci/download_models.sh
displayName: Download Models
- bash: ci/adb_push_and_run.sh build_dabnn/tests/net_test
displayName: Model Test

0 comments on commit 94dab18

Please sign in to comment.