提交 06b74c87 编写于 作者: A Alexander Alekhin

Merge pull request #21360 from alalek:core_ocl_option_to_abort_on_kernel_build_error_3.4

......@@ -153,6 +153,17 @@ static bool isRaiseError()
}
#endif
static void onOpenCLKernelBuildError()
{
// NB: no need to cache this value
bool value = cv::utils::getConfigurationParameterBool("OPENCV_OPENCL_ABORT_ON_BUILD_ERROR", false);
if (value)
{
fprintf(stderr, "Abort on OpenCL kernel build failure!\n");
abort();
}
}
#if CV_OPENCL_TRACE_CHECK
static inline
void traceOpenCLCheck(cl_int status, const char* message)
......@@ -3881,6 +3892,12 @@ struct Program::Impl
CV_OCL_DBG_CHECK(clReleaseProgram(handle));
handle = NULL;
}
if (retval != CL_SUCCESS &&
sourceName_ != "dummy" // used for testing of compilation flags
)
{
onOpenCLKernelBuildError();
}
}
#if CV_OPENCL_VALIDATE_BINARY_PROGRAMS
if (handle && CV_OPENCL_VALIDATE_BINARY_PROGRAMS_VALUE)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册