Merge pull request #2110 from hmax:master
This commit is contained in:
commit
ee88cc2c52
@ -202,3 +202,43 @@ PERF_TEST_P(Size_MatType, subtractScalar, TYPICAL_MATS_CORE_ARITHM)
|
||||
|
||||
SANITY_CHECK(c, 1e-8);
|
||||
}
|
||||
|
||||
PERF_TEST_P(Size_MatType, multiply, TYPICAL_MATS_CORE_ARITHM)
|
||||
{
|
||||
Size sz = get<0>(GetParam());
|
||||
int type = get<1>(GetParam());
|
||||
cv::Mat a(sz, type), b(sz, type), c(sz, type);
|
||||
|
||||
declare.in(a, b, WARMUP_RNG).out(c);
|
||||
if (CV_MAT_DEPTH(type) == CV_32S)
|
||||
{
|
||||
//According to docs, saturation is not applied when result is 32bit integer
|
||||
a /= (2 << 16);
|
||||
b /= (2 << 16);
|
||||
}
|
||||
|
||||
TEST_CYCLE() multiply(a, b, c);
|
||||
|
||||
SANITY_CHECK(c, 1e-8);
|
||||
}
|
||||
|
||||
PERF_TEST_P(Size_MatType, multiplyScale, TYPICAL_MATS_CORE_ARITHM)
|
||||
{
|
||||
Size sz = get<0>(GetParam());
|
||||
int type = get<1>(GetParam());
|
||||
cv::Mat a(sz, type), b(sz, type), c(sz, type);
|
||||
double scale = 0.5;
|
||||
|
||||
declare.in(a, b, WARMUP_RNG).out(c);
|
||||
|
||||
if (CV_MAT_DEPTH(type) == CV_32S)
|
||||
{
|
||||
//According to docs, saturation is not applied when result is 32bit integer
|
||||
a /= (2 << 16);
|
||||
b /= (2 << 16);
|
||||
}
|
||||
|
||||
TEST_CYCLE() multiply(a, b, c, scale);
|
||||
|
||||
SANITY_CHECK(c, 1e-8);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user