core(ocl): fix ocl::Image2d::isFormatSupported()

in case of OPENCV_OPENCL_DEVICE=disabled
pull/18092/head
Alexander Alekhin 5 years ago
parent 2171cae8ff
commit 00890aecdf
  1. 3
      modules/core/src/ocl.cpp

@ -6458,6 +6458,9 @@ struct Image2D::Impl
CV_Error(Error::OpenCLApiCallError, "OpenCL runtime not found!");
cl_context context = (cl_context)Context::getDefault().ptr();
if (!context)
return false;
// Figure out how many formats are supported by this context.
cl_uint numFormats = 0;
cl_int err = clGetSupportedImageFormats(context, CL_MEM_READ_WRITE,

Loading…
Cancel
Save