mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +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:
@@ -360,7 +360,7 @@ namespace
|
||||
CV_Assert( _src.type() == CV_8UC1 || _src.type() == CV_16UC1 );
|
||||
|
||||
#ifdef HAVE_OPENCL
|
||||
bool useOpenCL = cv::ocl::useOpenCL() && _src.isUMat() && _src.dims()<=2 && _src.type() == CV_8UC1;
|
||||
bool useOpenCL = cv::ocl::isOpenCLActivated() && _src.isUMat() && _src.dims()<=2 && _src.type() == CV_8UC1;
|
||||
#endif
|
||||
|
||||
int histSize = _src.type() == CV_8UC1 ? 256 : 65536;
|
||||
|
||||
Reference in New Issue
Block a user