OCL: tests: repair moments implementation in master branch, enable tests

This commit is contained in:
Alexander Alekhin 2013-08-22 23:33:11 +04:00
parent b7b584984e
commit 7685b983db
2 changed files with 5 additions and 5 deletions

View File

@ -146,7 +146,7 @@ static void icvContourMoments( CvSeq* contour, CvMoments* mom )
cl_int dst_step = (cl_int)dst_a.step; cl_int dst_step = (cl_int)dst_a.step;
args.push_back( std::make_pair( sizeof(cl_int) , (void *)&dst_step )); args.push_back( std::make_pair( sizeof(cl_int) , (void *)&dst_step ));
openCLExecuteKernel(dst_a.clCxt, &moments, "icvContourMoments", globalThreads, localThreads, args, -1, -1); openCLExecuteKernel2(dst_a.clCxt, &moments, "icvContourMoments", globalThreads, localThreads, args, -1, -1);
cv::Mat dst(dst_a); cv::Mat dst(dst_a);
a00 = a10 = a01 = a20 = a11 = a02 = a30 = a21 = a12 = a03 = 0.0; a00 = a10 = a01 = a20 = a11 = a02 = a30 = a21 = a12 = a03 = 0.0;
@ -301,7 +301,7 @@ static void ocl_cvMoments( const void* array, CvMoments* mom, int binary )
args.push_back( std::make_pair( sizeof(cl_int) , (void *)&coi )); args.push_back( std::make_pair( sizeof(cl_int) , (void *)&coi ));
args.push_back( std::make_pair( sizeof(cl_int) , (void *)&binary )); args.push_back( std::make_pair( sizeof(cl_int) , (void *)&binary ));
args.push_back( std::make_pair( sizeof(cl_int) , (void *)&TILE_SIZE )); args.push_back( std::make_pair( sizeof(cl_int) , (void *)&TILE_SIZE ));
openCLExecuteKernel(Context::getContext(), &moments, "CvMoments", globalThreads, localThreads, args, -1, depth); openCLExecuteKernel2(Context::getContext(), &moments, "CvMoments", globalThreads, localThreads, args, -1, depth);
size_t localThreadss[3] = { 128, 1, 1}; size_t localThreadss[3] = { 128, 1, 1};
size_t globalThreadss[3] = { 128, 1, 1}; size_t globalThreadss[3] = { 128, 1, 1};
@ -310,10 +310,10 @@ static void ocl_cvMoments( const void* array, CvMoments* mom, int binary )
args_sum.push_back( std::make_pair( sizeof(cl_int) , (void *)&tile_height )); args_sum.push_back( std::make_pair( sizeof(cl_int) , (void *)&tile_height ));
args_sum.push_back( std::make_pair( sizeof(cl_int) , (void *)&tile_width )); args_sum.push_back( std::make_pair( sizeof(cl_int) , (void *)&tile_width ));
args_sum.push_back( std::make_pair( sizeof(cl_int) , (void *)&TILE_SIZE )); args_sum.push_back( std::make_pair( sizeof(cl_int) , (void *)&TILE_SIZE ));
args_sum.push_back( std::make_pair( sizeof(cl_mem) , (void *)&sum )); args_sum.push_back( std::make_pair( sizeof(cl_mem) , (void *)&sum.data ));
args_sum.push_back( std::make_pair( sizeof(cl_mem) , (void *)&dst_m.data )); args_sum.push_back( std::make_pair( sizeof(cl_mem) , (void *)&dst_m.data ));
args_sum.push_back( std::make_pair( sizeof(cl_int) , (void *)&dst_m.step )); args_sum.push_back( std::make_pair( sizeof(cl_int) , (void *)&dst_m.step ));
openCLExecuteKernel(Context::getContext(), &moments, "dst_sum", globalThreadss, localThreadss, args_sum, -1, -1); openCLExecuteKernel2(Context::getContext(), &moments, "dst_sum", globalThreadss, localThreadss, args_sum, -1, -1);
Mat dstsum(sum); Mat dstsum(sum);
mom->m00 = dstsum.at<double>(0, 0); mom->m00 = dstsum.at<double>(0, 0);

View File

@ -34,7 +34,7 @@ PARAM_TEST_CASE(MomentsTest, MatType, bool)
}; };
TEST_P(MomentsTest, DISABLED_Mat) TEST_P(MomentsTest, Mat)
{ {
bool binaryImage = 0; bool binaryImage = 0;
SetUp(); SetUp();