CL is always crashed on android
Output of 'strings libarm_compute.so | grep arm_compute_version':
Platform: arm64-v8a
Operating System: Android 8.0
Problem description:
I'm trying to apply ACL to my android application using JNI. I can use NEON and GLES version, but CL is not working here. Whenever I call "CLScheduler::get().default_init()" in my JNI function, app is crashed leaving message "Fatal signal 6 (SIGABRT)", there's no other message. How can I use it in my android?
Did you build with either asserts=1 or debug=1 ?
Do you see anything in logcat or dmesg ?
If this is in a Java app then I suspect it is because OpenCL is not whitelisted on your device.
@AnthonyARM
Hello, I'm using the pre-built binary v18.05 for Android, android-arm64-v8a-cl-debug, but there's no other message. I'm using Samsung galaxy 9+ and if I run OpenCL-Z, it's telling me this device supports OpenCL 2.0. Is there any case that the vendor prevent 3rd-party app from using OpenCL?
It's an Android P and above restriction on all non-SDK interfaces: https://developer.android.com/preview/restrictions-non-sdk-interfaces Basically you can use OpenCL from native binaries, but not in APKs unless the manufacturer explicitly whitelist it (Which isn't the case for the S9)
@AnthonyARM But isn't that a restriction on Android P or above? I found that Android 8 is acturally Android O. However, I can't get this working either on a Samsung s9, so I wonder if there another layer of restriction upon those? I search up a bit, and found that the only official post related is this, https://android-developers.googleblog.com/2016/06/improving-stability-with-private-cc.html. Which I believe can be resolved if we manually include our own copy of the library in the app.
Thanks for the help.
Apparently, I solved my problem, by NOT putting the OpenCL library into the build. The app invokes the system library flawlessly. However, I believe this will not work on Android N or above which will be coming out pretty soon.
Closing for now as it seems you have solved the issue. Feel free to reopen it.