Comments (10)
https://groups.google.com/forum/#!msg/android-ndk/NbUq9FDDZOo/TJJsAS6nM7wJ
from caffe-android-lib.
Thanks @sh1r0 as per the link above JNI functions should be compiled with softfp but armeabi-v7a-hard-softfp still sets the ABI to armeabi-v7a-hard and CXXFLAGS to -mhard-float. The only difference being the flag -D_NDK_MATH_NO_SOFTFP=1, which I am not sure how it helps in this case?
from caffe-android-lib.
Please refer to tests/device/hard-float/jni/Android.mk
in Android NDK.
from caffe-android-lib.
I did and I understand the meaning of D_NDK_MATH_NO_SOFTFP=1 but I am not sure why is that needed to compile JNI code. Why can't armeabi-v7a-hard be used to compile JNI code? It seems like someone was able to compile the JNI code with armeabi-v7a-hard with NEON at #27 (comment). So my original question still remains, why armeabi-v7a-hard-softfp and not armeabi-v7a-hard?
So tests/device/hard-float/jni/Android.mk
says that using -D_NDK_MATH_NO_SOFTFP=1 links the library with libm_hard.a instead of libm.a. How is that helping with the JNI code?
from caffe-android-lib.
Sorry, per my previous tests, the current setup is the only way I can successfully make it. I guessed the key point is that JNI somehow needs softfp instead of hardfp. But if you succeed in making everything work by simply using armeabi-v7a-hard, please kindly let me know (PR is also welcome). Thanks.
from caffe-android-lib.
But again armeabi-v7a-hard-softfp that are using is still using hardfp with the exception on using libm for soft abi math functions. If JNI needs softfp then we should compile JNI code with softfp and not with armeabi-v7a-hard-softfp or armeabi-v7a-hard.
Thanks anyways. My setup is a little different where I don't have any JNI code but was trying to use openblas with softfp on ARM7 as rest of my system is softfp but OpenBLAS crashes on me. I have other libraries that are dependent on OpenCV for example so I can't compile opencv with hardfloat without breaking these other modules which would be required if I am compiling Caffe and OpenBLAS with hardfloat. I don't want to compile two copies of opencv one with softfp for other softfp module and hardffp for caffe and OpenBLAS.
Do you know of a way to call from softfp based library using floating point to call into Caffe compiled with hardfp? The link you mentioned says that adding
__attribute__((pcs("aapcs")))
is to tell to the compiler how a function expect to receive its arguments so it won't help unless I change the Caffe code to add this attribute to all the functions taking or returnign floats.
from caffe-android-lib.
If you hope to have everything with softfp, you can build openblas with ARMv5 as a workaround.
from caffe-android-lib.
Do you know if ARMv5 OpenBLAS is compatible with ARMv7 based chipsets?
from caffe-android-lib.
Yes, please refer to https://github.com/sh1r0/caffe-android-lib/blob/dev/scripts/build_openblas.sh.
from caffe-android-lib.
Thank you, will give that a try. Appreciate all your help. Your project was immensely helpful to me.
from caffe-android-lib.
Related Issues (20)
- Performance become very slow when using multiple threads to do net_->Forward();
- OpenBlas Build failed HOT 1
- Error while running ./build.sh HOT 1
- make: *** No rule to make target 'clean'. Stop. Failed to build OpenBLAS
- How to make pycaffe and build _caffe module HOT 1
- Failed to build OpenBLAS HOT 2
- hi, Failed to build OpenBLAS,libopenblas_atom-r0.2.18.a HOT 1
- Failed to build OpenBLAS: cannot stat 'libopenblas_armv8p-r0.3.0.dev.so': No such file or directory HOT 3
- can not use asset manager HOT 1
- Failed to build OpenBLAS? HOT 29
- Is it suitable for all network?
- Is trainning available on Android?
- Failed to find header file, during [make] process HOT 1
- armeabi-v7a with: command not found HOT 1
- libtool: error: unrecognised option: '-DHAVE_CONFIG_H' HOT 2
- Build error when linking libopenblas.a to libcaffe.so
- find: '/caffe-android-lib/toolchains/armeabi/bin/': No such file or directory
- Porting an exisiting caffe net for text recognition?
- run caffee demo error HOT 3
- Compilation failed at ndk-r19c
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from caffe-android-lib.