diff --git a/src/opencl_wrapper.cpp b/src/opencl_wrapper.cpp index caf523f708398eff010307bd7f7a365bde2757cc..edbd453ab2a265c9c47d26904b57d872387ea039 100644 --- a/src/opencl_wrapper.cpp +++ b/src/opencl_wrapper.cpp @@ -38,15 +38,17 @@ static const std::vector g_opencl_library_paths = { static std::mutex g_initMutex; static bool isInit = false; +static bool loadSuccess = false; static void *handle_{nullptr}; bool InitOpenCL() { std::lock_guard lock(g_initMutex); if (isInit){ - return true; + return loadSuccess; } - isInit = LoadOpenCLLibrary(&handle_); - return isInit; + isInit = true; + loadSuccess = LoadOpenCLLibrary(&handle_); + return loadSuccess; } bool UnLoadOpenCLLibrary(void *handle) {