Fix OpenCL build warnings

This commit is contained in:
Andrey Kamaev
2013-01-25 14:31:34 +04:00
parent b445f4b01d
commit 9509dfd1de
31 changed files with 963 additions and 949 deletions

View File

@@ -113,15 +113,15 @@ int main(int argc, char **argv)
print_info();
int flag = CVCL_DEVICE_TYPE_GPU;
// int flag = CVCL_DEVICE_TYPE_GPU;
if(type == "cpu")
// if(type == "cpu")
{
// {
flag = CVCL_DEVICE_TYPE_CPU;
// flag = CVCL_DEVICE_TYPE_CPU;
}
// }
std::vector<cv::ocl::Info> oclinfo;
int devnums = getDevice(oclinfo);
if(devnums <= device || device < 0)

View File

@@ -2597,13 +2597,13 @@ TEST_P(Sum, MAT)
Has_roi(k);
t0 = (double)cvGetTickCount();//cpu start
Scalar cpures = cv::sum(mat1_roi);
cv::sum(mat1_roi);
t0 = (double)cvGetTickCount() - t0;//cpu end
t1 = (double)cvGetTickCount();//gpu start1
gmat1 = mat1_roi;
t2 = (double)cvGetTickCount(); //kernel
Scalar gpures = cv::ocl::sum(gmat1);
cv::ocl::sum(gmat1);
t2 = (double)cvGetTickCount() - t2;//kernel
t1 = (double)cvGetTickCount() - t1;//gpu end1
if(j == 0)

View File

@@ -109,15 +109,15 @@ TEST_F(Haar, FaceDetect)
double t = 0;
vector<Rect> faces, oclfaces;
const static Scalar colors[] = { CV_RGB(0, 0, 255),
CV_RGB(0, 128, 255),
CV_RGB(0, 255, 255),
CV_RGB(0, 255, 0),
CV_RGB(255, 128, 0),
CV_RGB(255, 255, 0),
CV_RGB(255, 0, 0),
CV_RGB(255, 0, 255)
} ;
// const static Scalar colors[] = { CV_RGB(0, 0, 255),
// CV_RGB(0, 128, 255),
// CV_RGB(0, 255, 255),
// CV_RGB(0, 255, 0),
// CV_RGB(255, 128, 0),
// CV_RGB(255, 255, 0),
// CV_RGB(255, 0, 0),
// CV_RGB(255, 0, 255)
// } ;
Mat gray, smallImg(cvRound (img.rows / scale), cvRound(img.cols / scale), CV_8UC1 );
MemStorage storage(cvCreateMemStorage(0));

View File

@@ -379,7 +379,7 @@ TEST_P(bilateralFilter, Mat)
}
else
{
for(int i = 0; i < sizeof(bordertype) / sizeof(int); i++)
for(size_t i = 0; i < sizeof(bordertype) / sizeof(int); i++)
{
cout << borderstr[i] << endl;
#ifndef PRINT_KERNEL_RUN_TIME
@@ -397,7 +397,7 @@ TEST_P(bilateralFilter, Mat)
for(int j = 0; j < LOOP_TIMES + 1; j ++)
{
Has_roi(k);
if(((bordertype[i] != cv::BORDER_CONSTANT) && (bordertype[i] != cv::BORDER_REPLICATE)) && (mat1_roi.cols <= radius) || (mat1_roi.cols <= radius) || (mat1_roi.rows <= radius) || (mat1_roi.rows <= radius))
if(((bordertype[i] != cv::BORDER_CONSTANT) && (bordertype[i] != cv::BORDER_REPLICATE) && (mat1_roi.cols <= radius)) || (mat1_roi.cols <= radius) || (mat1_roi.rows <= radius) || (mat1_roi.rows <= radius))
{
continue;
}
@@ -482,7 +482,7 @@ TEST_P(CopyMakeBorder, Mat)
}
else
{
for(int i = 0; i < sizeof(bordertype) / sizeof(int); i++)
for(size_t i = 0; i < sizeof(bordertype) / sizeof(int); i++)
{
#ifndef PRINT_KERNEL_RUN_TIME
double totalcputick = 0;
@@ -1133,7 +1133,6 @@ PARAM_TEST_CASE(Remap, MatType, MatType, MatType, int, int)
cv::RNG &rng = TS::ptr()->get_rng();
cv::Size srcSize = cv::Size(MWIDTH, MHEIGHT);
cv::Size dstSize = cv::Size(MWIDTH, MHEIGHT);
cv::Size map1Size = cv::Size(MWIDTH, MHEIGHT);
double min = 5, max = 16;

View File

@@ -38,6 +38,15 @@
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifdef __GNUC__
# pragma GCC diagnostic ignored "-Wmissing-declarations"
# if defined __clang__ || defined __APPLE__
# pragma GCC diagnostic ignored "-Wmissing-prototypes"
# pragma GCC diagnostic ignored "-Wextra"
# endif
#endif
#ifndef __OPENCV_TEST_PRECOMP_HPP__
#define __OPENCV_TEST_PRECOMP_HPP__

View File

@@ -84,12 +84,12 @@ double checkSimilarity(const cv::Mat &m1, const cv::Mat &m2);
EXPECT_LE(checkNorm(cv::Mat(mat)), eps) \
}
//#define EXPECT_MAT_NEAR(mat1, mat2, eps) \
//{ \
// ASSERT_EQ(mat1.type(), mat2.type()); \
// ASSERT_EQ(mat1.size(), mat2.size()); \
// EXPECT_LE(checkNorm(cv::Mat(mat1), cv::Mat(mat2)), eps); \
//}
/*#define EXPECT_MAT_NEAR(mat1, mat2, eps) \
{ \
ASSERT_EQ(mat1.type(), mat2.type()); \
ASSERT_EQ(mat1.size(), mat2.size()); \
EXPECT_LE(checkNorm(cv::Mat(mat1), cv::Mat(mat2)), eps); \
}*/
#define EXPECT_MAT_NEAR(mat1, mat2, eps,s) \
{ \