mirror of
https://github.com/opencv/opencv.git
synced 2024-11-30 06:10:02 +08:00
remove g_isOpenCVActivated assign and clarify
This commit is contained in:
parent
619cc01ca1
commit
bb59b81d82
@ -1150,7 +1150,7 @@ void OpenCLExecutionContext::release()
|
||||
|
||||
|
||||
// true if we have initialized OpenCL subsystem with available platforms
|
||||
static bool g_isOpenCVActivated = false;
|
||||
static bool g_isOpenCLActivated = false;
|
||||
|
||||
bool haveOpenCL()
|
||||
{
|
||||
@ -1178,7 +1178,7 @@ bool haveOpenCL()
|
||||
{
|
||||
cl_uint n = 0;
|
||||
g_isOpenCLAvailable = ::clGetPlatformIDs(0, NULL, &n) == CL_SUCCESS;
|
||||
g_isOpenCVActivated = n > 0;
|
||||
g_isOpenCLActivated = n > 0;
|
||||
CV_LOG_INFO(NULL, "OpenCL: found " << n << " platforms");
|
||||
}
|
||||
catch (...)
|
||||
@ -1214,7 +1214,7 @@ bool useOpenCL()
|
||||
|
||||
bool isOpenCLActivated()
|
||||
{
|
||||
if (!g_isOpenCVActivated)
|
||||
if (!g_isOpenCLActivated)
|
||||
return false; // prevent unnecessary OpenCL activation via useOpenCL()->haveOpenCL() calls
|
||||
return useOpenCL();
|
||||
}
|
||||
@ -6370,7 +6370,6 @@ public:
|
||||
static OpenCLAllocator* getOpenCLAllocator_() // call once guarantee
|
||||
{
|
||||
static OpenCLAllocator* g_allocator = new OpenCLAllocator(); // avoid destructor call (using of this object is too wide)
|
||||
g_isOpenCVActivated = true;
|
||||
return g_allocator;
|
||||
}
|
||||
MatAllocator* getOpenCLAllocator()
|
||||
|
Loading…
Reference in New Issue
Block a user