diff --git a/src/opencl_wrapper.cpp b/src/opencl_wrapper.cpp index 81cb91f00fd946deb73e556d089ae42a1d77a0a4..c7d7db25c8f01513be328fc537286116de651666 100644 --- a/src/opencl_wrapper.cpp +++ b/src/opencl_wrapper.cpp @@ -86,6 +86,7 @@ bool UnLoadCLExtern(void *clSoHandle) static bool LoadLibraryFromPath(const std::string &library_path, void **handle_ptr) { + bool load_success = true; if (handle_ptr == nullptr) { return false; } @@ -99,8 +100,8 @@ static bool LoadLibraryFromPath(const std::string &library_path, void **handle_p #define LOAD_OPENCL_FUNCTION_PTR(func_name) \ func_name = reinterpret_cast(dlsym(*handle_ptr, #func_name)); \ if (func_name == nullptr) { \ - return false; \ - } + load_success = false; \ + } \ LOAD_OPENCL_FUNCTION_PTR(clGetPlatformIDs); LOAD_OPENCL_FUNCTION_PTR(clGetPlatformInfo); @@ -168,7 +169,7 @@ static bool LoadLibraryFromPath(const std::string &library_path, void **handle_p LOAD_OPENCL_FUNCTION_PTR(clSetKernelArgSVMPointer); #endif - return true; + return load_success; } // load default library path bool LoadOpenCLLibrary(void **handle_ptr)