I am trying to build OpenCL SDK for ANDROID from this source --> https://github.com/KhronosGroup/OpenCL-SDK
I got build ".so" files or ".a" files but they don't not work at all even if they got linked properly.
I think I can't load all the symbols to my ".so" or ".a" files while I building it. I have to load symbols from my device's /system/vendor/lib64/libOpenCL.so. In other words, OPENCL_ICD_LOADER can't detect my device's opencl platform.
My device is a SM-X700. It contains Adreno 730 GPU.
When I open one of the libOpenCL.a or libOpenCL.so files that I got build in text editor, I see somethings like below
!<arch>
/ 0 0 0 0 3808 `
���������������������������7��7��7��7��7��7��\��
failed to load library %s
�_�_ �`��T�����_�����OCL_ICD_ENABLE_TRACE�True�true�T�1�KHR ICD trace at %s:%d:
�already loaded vendor %s, nothing to do here
�clGetExtensionFunctionAddress�failed to get function address clGetExtensionFunctionAddress
�clIcdGetPlatformIDsKHR�failed to get extension function address clIcdGetPlatformIDsKHR
�failed clIcdGetPlatformIDs
�failed to allocate memory
�failed get platform handle to library
�successfully added vendor %s with suffix %s
I installed the triplet for arm64-v8a in vcpkg using the link below --> https://learn.microsoft.com/en-us/vcpkg/users/platforms/android
And this is my cmake configuration
cmake -D CMAKE_BUILD_TYPE=Release \
-D BUILD_TESTING=OFF \
-D BUILD_DOCS=OFF \
-D BUILD_EXAMPLES=OFF \
-D BUILD_TESTS=OFF \
-D OPENCL_SDK_BUILD_SAMPLES=OFF \
-D OPENCL_SDK_TEST_SAMPLES=OFF \
-D CMAKE_C_COMPILER="/home/my_user_name/Android/Sdk/ndk/25.0.8775105/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" \
-D CMAKE_CXX_COMPILER="/home/my_user_name/Android/Sdk/ndk/25.0.8775105/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++" \
-D CMAKE_TOOLCHAIN_FILE=/home/my_user_name/vcpkg/scripts/buildsystems/vcpkg.cmake \
-D VCPKG_CHAINLOAD_TOOLCHAIN_FILE=/home/my_user_name/Android/Sdk/ndk/25.0.8775105/build/cmake/android.toolchain.cmake \
-D VCPKG_TARGET_TRIPLET=arm64-android \
-D ANDROID_ABI=arm64-v8a \
-D ANDROID_PLATFORM=33 \
-D CMAKE_INSTALL_PREFIX=/home/my_user_name/OPENCL_AARCH64_OUT \
-D BUILD_SHARED_LIBS=OFF \
..
I want to use OpenCL in my c++-native project on Android. Please help me.
I tried to compile other NDK versions below 25.0.8775105
I found someone who struggle with same problem in this link--> https://developer.qualcomm.com/forum/qdn-forums/software/adreno-gpu-sdk/68895