This source file includes following definitions.
- PARAM_TEST_CASE
- OCL_TEST_P
- OCL_TEST_P
- OCL_TEST_P
#include "../test_precomp.hpp"
#include "opencv2/ts/ocl_test.hpp"
#ifdef HAVE_OPENCL
namespace cvtest {
namespace ocl {
PARAM_TEST_CASE(UMatExpr, MatDepth, Channels)
{
int type;
Size size;
virtual void SetUp()
{
type = CV_MAKE_TYPE(GET_PARAM(0), GET_PARAM(1));
}
void generateTestData()
{
size = randomSize(1, MAX_VALUE);
}
};
OCL_TEST_P(UMatExpr, Eye)
{
for (int j = 0; j < test_loop_times; j++)
{
generateTestData();
Mat m = Mat::eye(size, type);
UMat um = UMat::eye(size, type);
EXPECT_MAT_NEAR(m, um, 0);
}
}
OCL_TEST_P(UMatExpr, Zeros)
{
for (int j = 0; j < test_loop_times; j++)
{
generateTestData();
Mat m = Mat::zeros(size, type);
UMat um = UMat::zeros(size, type);
EXPECT_MAT_NEAR(m, um, 0);
}
}
OCL_TEST_P(UMatExpr, Ones)
{
for (int j = 0; j < test_loop_times; j++)
{
generateTestData();
Mat m = Mat::ones(size, type);
UMat um = UMat::ones(size, type);
EXPECT_MAT_NEAR(m, um, 0);
}
}
OCL_INSTANTIATE_TEST_CASE_P(MatrixOperation, UMatExpr, Combine(OCL_ALL_DEPTHS, OCL_ALL_CHANNELS));
} }
#endif