From 7704dbf866d19c3be64a574b3e8e4d08707a223a Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Tue, 5 Nov 2013 15:15:26 +0400 Subject: [PATCH] ocl: svm: restore non BLAS version --- modules/ocl/src/svm.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/modules/ocl/src/svm.cpp b/modules/ocl/src/svm.cpp index 40b3d981d..3e51d8691 100644 --- a/modules/ocl/src/svm.cpp +++ b/modules/ocl/src/svm.cpp @@ -994,13 +994,15 @@ void CvSVMKernel_ocl::calc( int vcount, const int row_idx, Qfloat* results, Mat& //int j; (this->*calc_func_ocl)( vcount, row_idx, results, src); -// FIXIT #if defined HAVE_CLAMDBLAS +#if !defined(HAVE_CLAMDBLAS) + // nothing +#else const Qfloat max_val = (Qfloat)(FLT_MAX * 1e-3); int j; for( j = 0; j < vcount; j++ ) if( results[j] > max_val ) results[j] = max_val; -// FIXIT #endif +#endif } bool CvSVMKernel_ocl::create( const CvSVMParams* _params, Calc_ocl _calc_func, Calc _calc_func1 ) @@ -1072,12 +1074,13 @@ void CvSVMKernel_ocl::calc_poly( int vcount, const int row_idx, Qfloat* results, { calc_non_rbf_base( vcount, row_idx, results, src); -//FIXIT #if defined HAVE_CLAMDBLAS - +#if !defined(HAVE_CLAMDBLAS) + // nothing +#else CvMat R = cvMat( 1, vcount, QFLOAT_TYPE, results ); if( vcount > 0 ) cvPow( &R, &R, params->degree ); -//FIXIT #endif +#endif } @@ -1085,7 +1088,9 @@ void CvSVMKernel_ocl::calc_sigmoid( int vcount, const int row_idx, Qfloat* resul { calc_non_rbf_base( vcount, row_idx, results, src); // TODO: speedup this -//FIXIT #if defined HAVE_CLAMDBLAS +#if !defined(HAVE_CLAMDBLAS) + // nothing +#else for(int j = 0; j < vcount; j++ ) { Qfloat t = results[j]; @@ -1095,7 +1100,7 @@ void CvSVMKernel_ocl::calc_sigmoid( int vcount, const int row_idx, Qfloat* resul else results[j] = (Qfloat)((e - 1.) / (e + 1.)); } -//FIXIT #endif +#endif } CvSVM_OCL::CvSVM_OCL()