From 63201d7327d73b8bb1a52a284831063f3483462b Mon Sep 17 00:00:00 2001 From: "cuijiawei14@huawei.com" Date: Thu, 9 Mar 2023 10:22:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8Dmusl=E7=89=88=E6=9C=AC?= =?UTF-8?q?=EF=BC=8Cmusl=E7=A6=81=E6=AD=A2dlclose?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cuijiawei14@huawei.com --- src/opencl_wrapper.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/opencl_wrapper.cpp b/src/opencl_wrapper.cpp index 756a70b..caf523f 100644 --- a/src/opencl_wrapper.cpp +++ b/src/opencl_wrapper.cpp @@ -30,14 +30,15 @@ static const std::vector g_opencl_library_paths = { #if defined(__APPLE__) || defined(__MACOSX) "libOpenCL.so", "/System/Library/Frameworks/OpenCL.framework/OpenCL" #else + "/vendor/lib64/chipsetsdk/libGLES_mali.so", "/system/lib64/libGLES_mali.so", "libGLES_mali.so", #endif }; static std::mutex g_initMutex; -bool isInit = false; -void *handle_{nullptr}; +static bool isInit = false; +static void *handle_{nullptr}; bool InitOpenCL() { std::lock_guard lock(g_initMutex); @@ -49,6 +50,9 @@ bool InitOpenCL() { } bool UnLoadOpenCLLibrary(void *handle) { +#ifdef __MUSL__ + return true; +#else if (handle != nullptr) { if (dlclose(handle) != 0) { return false; @@ -56,6 +60,7 @@ bool UnLoadOpenCLLibrary(void *handle) { return true; } return true; +#endif } bool LoadLibraryFromPath(const std::string &library_path, void **handle_ptr) { -- Gitee