mirror of
https://gitee.com/openharmony/third_party_opencl-headers
synced 2024-11-26 16:50:30 +00:00
InitOpenCL修改
Signed-off-by: cuijiawei14@huawei.com <cuijiawei14@huawei.com>
This commit is contained in:
parent
63201d7327
commit
ed60190b7e
@ -38,15 +38,17 @@ static const std::vector<std::string> 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<std::mutex> 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) {
|
||||
|
Loading…
Reference in New Issue
Block a user