mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
ocl: avoid unnecessary loading/initializing OpenCL subsystem
If there are no OpenCL/UMat methods calls from application. OpenCL subsystem is initialized: - haveOpenCL() is called from application - useOpenCL() is called from application - access to OpenCL allocator: UMat is created (empty UMat is ignored) or UMat <-> Mat conversions are called Don't call OpenCL functions if OPENCV_OPENCL_RUNTIME=disabled (independent from OpenCL linkage type)
This commit is contained in:
@@ -141,7 +141,7 @@ void UMatData::unlock()
|
||||
MatAllocator* UMat::getStdAllocator()
|
||||
{
|
||||
#ifdef HAVE_OPENCL
|
||||
if( ocl::haveOpenCL() && ocl::useOpenCL() )
|
||||
if (ocl::useOpenCL())
|
||||
return ocl::getOpenCLAllocator();
|
||||
#endif
|
||||
return Mat::getDefaultAllocator();
|
||||
|
||||
Reference in New Issue
Block a user