summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2017-09-26 21:23:53 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2017-09-26 21:23:53 +0200
commit2949e156f5bfdd724987e67477da3e3608e4aaf9 (patch)
tree7be6606bd21433584541afb20c7d27d7330cc176 /README.md
parent00b57714779e207b156fca508cc10e4d569405b6 (diff)
Added notes for Android compilation of CLBlast
Diffstat (limited to 'README.md')
-rw-r--r--README.md25
1 files changed, 25 insertions, 0 deletions
diff --git a/README.md b/README.md
index e8db38d2..f789580a 100644
--- a/README.md
+++ b/README.md
@@ -316,6 +316,31 @@ Since there is no half-precision data-type in C or C++, OpenCL provides the `cl_
The `samples/haxpy.c` example shows how to use these convenience functions when calling the half-precision BLAS routine HAXPY.
+Notes for Android
+-------------
+
+For deployment on Android, there are three options to consider.
+
+First of all, you can use Google's recommended route of installing Android Studio with the NDK, and then use the JNI to interface to the CLBlast library. For this, we refer to the official Android Studio documentation and the online tutorials.
+
+Alternatively, you can cross-compile the library and the test/client/tuner executables directly. To do so, first install the NDK, then find your vendor's OpenCL library (e.g. in `/system/vendor/lib`), and invoke CMake as follows:
+
+ cmake .. \
+ -DCMAKE_SYSTEM_NAME=Android \
+ -DCMAKE_SYSTEM_VERSION=26 \ # Set the appropriate Android API level
+ -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a \ # Set the appropriate device architecture
+ -DCMAKE_ANDROID_NDK=$ANDROID_NDK_PATH \ # Assumes $ANDROID_NDK_PATH points to your NDK installation
+ -DCMAKE_ANDROID_STL_TYPE=c++_shared \
+ -DOPENCL_ROOT=/path/to/vendor/OpenCL/lib/folder/
+
+For any potential issues, first check [cmath 'has not been declared' errors](https://stackoverflow.com/questions/45183525/compilation-error-with-ndk-using-cstatic/46433625).
+
+Finally, a third option is to use the [Collective Knowledge framework](https://github.com/ctuning/ck) in combination with the NDK, e.g. as follows:
+
+ sudo pip install ck
+ ck pull repo:ck-math
+ ck install package:lib-clblast-master-universal --target_os=android21-arm64
+
Contributing
-------------