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

OpenCL 1.2 support #615

Closed
xiaofengren opened this issue Oct 20, 2018 · 3 comments
Closed

OpenCL 1.2 support #615

xiaofengren opened this issue Oct 20, 2018 · 3 comments

Comments

@xiaofengren
Copy link

May I know whether NCNN opencl branch can support OpenCL 1.2? On my arm platform, it only find OpenCL 1.2 (Found OpenCL: /usr/lib/libOpenCL.so (found version "1.2") ).

When I build ncnn with OpenCL, it will report a lot of library unmatched error, like as followings:

../src/libncnn.a(modelbin.cpp.o): In function ncnn::ModelBin::load(int, int, int, int) const': modelbin.cpp:(.text+0x1354): undefined reference to clReleaseMemObject'
modelbin.cpp:(.text+0x15dc): undefined reference to clReleaseMemObject' modelbin.cpp:(.text+0x172c): undefined reference to clReleaseMemObject'
modelbin.cpp:(.text+0x1748): undefined reference to clReleaseMemObject' modelbin.cpp:(.text+0x17c0): undefined reference to clCreateBuffer'
modelbin.cpp:(.text+0x1858): undefined reference to clReleaseMemObject' modelbin.cpp:(.text+0x18c8): undefined reference to clCreateBuffer'
../src/libncnn.a(paramdict.cpp.o): In function ncnn::ParamDict::set(int, ncnn::Mat const&)': paramdict.cpp:(.text+0x248): undefined reference to clReleaseMemObject'
../src/libncnn.a(paramdict.cpp.o): In function ncnn::ParamDict::clear()': paramdict.cpp:(.text+0x388): undefined reference to clReleaseMemObject'
paramdict.cpp:(.text+0x3ac): undefined reference to clReleaseMemObject' ../src/libncnn.a(paramdict.cpp.o): In function ncnn::ParamDict::load_param(_IO_FILE*)':
paramdict.cpp:(.text+0x778): undefined reference to clReleaseMemObject' paramdict.cpp:(.text+0x7e4): undefined reference to clCreateBuffer'
../src/libncnn.a(paramdict.cpp.o): In function ncnn::ParamDict::load_param_bin(_IO_FILE*)': paramdict.cpp:(.text+0xa98): undefined reference to clCreateBuffer'
paramdict.cpp:(.text+0xad4): undefined reference to clReleaseMemObject' ../src/libncnn.a(paramdict.cpp.o): In function ncnn::ParamDict::load_param(unsigned char const*&)':
paramdict.cpp:(.text+0xcb0): undefined reference to clCreateBuffer' paramdict.cpp:(.text+0xd04): undefined reference to clReleaseMemObject'

The GPU what I used is not Mali GPU, so can it be supported?

@xiaofengren
Copy link
Author

After modify CMakeCache.txt file to implicitly add OpenCL library, it can build successfully.

//Flags used by the linker during all build types.
CMAKE_EXE_LINKER_FLAGS:STRING= -lOpenCL

//Flags used by the linker during DEBUG builds.
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= -lOpenCL

//Flags used by the linker during MINSIZEREL builds.
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=

//Flags used by the linker during RELEASE builds.
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= -lOpenCL

//Flags used by the linker during RELWITHDEBINFO builds.
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= -lOpenCL

@nihui
Copy link
Member

nihui commented Oct 22, 2018

the opencl branch is deprecated, do not use it
for gpu inference, vulkan will be picked for future adoption

@nihui nihui closed this as completed Oct 22, 2018
@xiaofengren
Copy link
Author

Thank you so much for your clarification. Look forward vulkan support.

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

2 participants