Merge pull request #2341 from alalek:ocl_fix_error_processing

This commit is contained in:
Andrey Pavlenko 2014-02-18 13:27:38 +04:00 committed by OpenCV Buildbot
commit b3cfe6b446
3 changed files with 9 additions and 3 deletions

View File

@ -118,7 +118,9 @@ static void* openclamdblas_check_fn(int ID)
void* func = CV_CL_GET_PROC_ADDRESS(e->fnName); void* func = CV_CL_GET_PROC_ADDRESS(e->fnName);
if (!func) 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; *(e->ppFn) = func;
return func; return func;

View File

@ -118,7 +118,9 @@ static void* openclamdfft_check_fn(int ID)
void* func = CV_CL_GET_PROC_ADDRESS(e->fnName); void* func = CV_CL_GET_PROC_ADDRESS(e->fnName);
if (!func) 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; *(e->ppFn) = func;
return func; return func;

View File

@ -201,7 +201,9 @@ static void* opencl_check_fn(int ID)
void* func = CV_CL_GET_PROC_ADDRESS(e->fnName); void* func = CV_CL_GET_PROC_ADDRESS(e->fnName);
if (!func) 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; *(e->ppFn) = func;
return func; return func;