Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clGetPlatformIDs return -1001 for android emulator and real phone #89

Open
DavdGao opened this issue Oct 25, 2023 · 1 comment
Open

Comments

@DavdGao
Copy link

DavdGao commented Oct 25, 2023

I cross-compiled OpenCL-SDK as follows. However, when I run clGetPlatformIDs function, it returns -1001. What can I do to fix it?

#!/bin/bash 

set -e

git clone --recurse-submodules https://github.com/KhronosGroup/OpenCL-SDK.git
mkdir OpenCL-SDK/build
cd OpenCL-SDK/build


# cross-compile for  android
NDK_PATH=/Users/david/Library/Android/sdk/ndk/25.1.8937393/
TOOLCHAIN=${NDK_PATH}/toolchains/llvm/prebuilt/darwin-x86_64

cmake .. \
	-DCMAKE_BUILD_TYPE=Release \
	-DBUILD_DOCS=OFF \
	-DBUILD_EXAMPLES=OFF \
	-DBUILD_TESTING=OFF \
	-DBUILD_TESTS=OFF \
	-DOPENCL_SDK_BUILD_SAMPLES=OFF \
	-DOPENCL_SDK_TEST_SAMPLES=OFF \
	-DCMAKE_TOOLCHAIN_FILE=${NDK_PATH}/build/cmake/android.toolchain.cmake \
	-DCMAKE_C_COMPILER=${TOOLCHAIN}/bin/aarch64-linux-android33-clang \
	-DCMAKE_CXX_COMPILER=${TOOLCHAIN}/bin/aarch64-linux-android-33-clang++ \
	-DBUILD_SHARED_LIBS=OFF \
	-DBUILD_STATIC_LIBS=ON \
	-DANDROID_ABI=arm64-v8a \
	-DANDROID_PLATFORM=android-33

cmake --build . --config Release
cmake --install . --prefix install_android
@DavdGao
Copy link
Author

DavdGao commented Oct 25, 2023

maybe related to #84

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant