A code example for OpenCL/Vulkan programming.
build for x86 (need libOpenCL.so)
mkdir build
cd build
cmake ..
make
build for Android (need Android NDK, armv8 libOpenCL.so)
mkdir build-android
cd build-android
cmake -DCMAKE_TOOLCHAIN_FILE=$NDK_ROOT/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-23 -DCMAKE_C_FLAGS=-march=armv8.4a+dotprod ..
make
A simple code in kernel/kernel.cl
(multiply each element in one array with 2).
./main ../kernel/kernel.cl