From 915fb632fd82593dafed5c31c198a8c64872d639 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Fri, 14 Feb 2014 19:50:58 +0400 Subject: [PATCH] core/ocl: change error processing for missed function --- modules/core/src/opencl/runtime/opencl_clamdblas.cpp | 4 +++- modules/core/src/opencl/runtime/opencl_clamdfft.cpp | 4 +++- modules/core/src/opencl/runtime/opencl_core.cpp | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/core/src/opencl/runtime/opencl_clamdblas.cpp b/modules/core/src/opencl/runtime/opencl_clamdblas.cpp index fceda79ac1..420fdb97d3 100644 --- a/modules/core/src/opencl/runtime/opencl_clamdblas.cpp +++ b/modules/core/src/opencl/runtime/opencl_clamdblas.cpp @@ -118,7 +118,9 @@ static void* openclamdblas_check_fn(int ID) void* func = CV_CL_GET_PROC_ADDRESS(e->fnName); if (!func) { - CV_Error(cv::Error::OpenCLApiCallError, cv::format("OpenCL AMD BLAS function is not available: [%s]", e->fnName)); + throw cv::Exception(cv::Error::OpenCLApiCallError, + cv::format("OpenCL AMD BLAS function is not available: [%s]", e->fnName), + CV_Func, __FILE__, __LINE__); } *(e->ppFn) = func; return func; diff --git a/modules/core/src/opencl/runtime/opencl_clamdfft.cpp b/modules/core/src/opencl/runtime/opencl_clamdfft.cpp index 2d8b964d4c..36a9ed2a71 100644 --- a/modules/core/src/opencl/runtime/opencl_clamdfft.cpp +++ b/modules/core/src/opencl/runtime/opencl_clamdfft.cpp @@ -118,7 +118,9 @@ static void* openclamdfft_check_fn(int ID) void* func = CV_CL_GET_PROC_ADDRESS(e->fnName); if (!func) { - CV_Error(cv::Error::OpenCLApiCallError, cv::format("OpenCL AMD FFT function is not available: [%s]", e->fnName)); + throw cv::Exception(cv::Error::OpenCLApiCallError, + cv::format("OpenCL AMD FFT function is not available: [%s]", e->fnName), + CV_Func, __FILE__, __LINE__); } *(e->ppFn) = func; return func; diff --git a/modules/core/src/opencl/runtime/opencl_core.cpp b/modules/core/src/opencl/runtime/opencl_core.cpp index df91f92848..5dbc85ec10 100644 --- a/modules/core/src/opencl/runtime/opencl_core.cpp +++ b/modules/core/src/opencl/runtime/opencl_core.cpp @@ -201,7 +201,9 @@ static void* opencl_check_fn(int ID) void* func = CV_CL_GET_PROC_ADDRESS(e->fnName); if (!func) { - CV_Error(cv::Error::OpenCLApiCallError, cv::format("OpenCL function is not available: [%s]", e->fnName)); + throw cv::Exception(cv::Error::OpenCLApiCallError, + cv::format("OpenCL function is not available: [%s]", e->fnName), + CV_Func, __FILE__, __LINE__); } *(e->ppFn) = func; return func;