Maratyszcza / NNPACK

Acceleration package for neural networks on multi-core CPUs
BSD 2-Clause "Simplified" License
1.67k stars 317 forks source link

How to build NNPACK for Android #127

Closed waynehong666 closed 6 years ago

waynehong666 commented 6 years ago

There is no jni folder in NNPACK. How should I build NNPACK for Android.

Maratyszcza commented 6 years ago

NNPACK switched to CMake for most builds. To build it with the new build system:

cd NNPACK/build
cmake -DANDROID_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.cmake.toolchain -DANDROID_TOOLCHAIN=gcc ..
make

For additional options (e.g. how to build for a different Android ABI), see Android NDK CMake guide

waynehong666 commented 6 years ago

When building the tests, I got the following error: error: undefined reference to 'nnp_sgemm_only_6x8__aarch32_neon'

Are the tests working on Android devices?

Maratyszcza commented 6 years ago

@waynehong666: i reproduced the error, and fixed with 20385210dabbae919d9c410d4f824c3913a7cedd