added perf test for dot product (8U, 32S, 32F)
This commit is contained in:
parent
457b8d7bff
commit
70da780c8e
@ -25,4 +25,4 @@ PERF_TEST_P(Size_MatType, dft, TEST_MATS_DFT)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SANITY_CHECK(dst, 1e-5);
|
SANITY_CHECK(dst, 1e-5);
|
||||||
}
|
}
|
||||||
|
32
modules/core/perf/perf_dot.cpp
Normal file
32
modules/core/perf/perf_dot.cpp
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
using namespace cv;
|
||||||
|
using namespace perf;
|
||||||
|
|
||||||
|
typedef tr1::tuple<int, int> MatType_Length_t;
|
||||||
|
typedef TestBaseWithParam<MatType_Length_t> MatType_Length;
|
||||||
|
|
||||||
|
PERF_TEST_P( MatType_Length, dot,
|
||||||
|
testing::Combine(
|
||||||
|
testing::Values( CV_8UC1, CV_32SC1, CV_32FC1 ),
|
||||||
|
testing::Values( 32, 64, 128, 256, 512, 1024 )
|
||||||
|
))
|
||||||
|
{
|
||||||
|
unsigned int type = std::tr1::get<0>(GetParam());
|
||||||
|
unsigned int size = std::tr1::get<1>(GetParam());
|
||||||
|
Mat a(size, size, type);
|
||||||
|
Mat b(size, size, type);
|
||||||
|
|
||||||
|
declare.in(a, WARMUP_RNG);
|
||||||
|
declare.in(b, WARMUP_RNG);
|
||||||
|
|
||||||
|
double product;
|
||||||
|
|
||||||
|
TEST_CYCLE(100)
|
||||||
|
{
|
||||||
|
product = a.dot(b);
|
||||||
|
}
|
||||||
|
|
||||||
|
SANITY_CHECK(product, 1e-5);
|
||||||
|
}
|
@ -8,7 +8,7 @@ using namespace perf;
|
|||||||
#define TYPICAL_MAT_TYPES_MINMAX CV_8SC1, CV_8SC4, CV_32SC1, CV_32FC1
|
#define TYPICAL_MAT_TYPES_MINMAX CV_8SC1, CV_8SC4, CV_32SC1, CV_32FC1
|
||||||
#define TYPICAL_MATS_MINMAX testing::Combine( testing::Values( TYPICAL_MAT_SIZES_MINMAX), testing::Values( TYPICAL_MAT_TYPES_MINMAX) )
|
#define TYPICAL_MATS_MINMAX testing::Combine( testing::Values( TYPICAL_MAT_SIZES_MINMAX), testing::Values( TYPICAL_MAT_TYPES_MINMAX) )
|
||||||
|
|
||||||
PERF_TEST_P(Size_MatType, min_double, TYPICAL_MATS_MINMAX)
|
PERF_TEST_P(Size_MatType, min_double, TYPICAL_MATS_MINMAX)
|
||||||
{
|
{
|
||||||
Size sz = std::tr1::get<0>(GetParam());
|
Size sz = std::tr1::get<0>(GetParam());
|
||||||
int type = std::tr1::get<1>(GetParam());
|
int type = std::tr1::get<1>(GetParam());
|
||||||
@ -23,7 +23,7 @@ PERF_TEST_P(Size_MatType, min_double, TYPICAL_MATS_MINMAX)
|
|||||||
SANITY_CHECK(c);
|
SANITY_CHECK(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
PERF_TEST_P(Size_MatType, max_double, TYPICAL_MATS_MINMAX)
|
PERF_TEST_P(Size_MatType, max_double, TYPICAL_MATS_MINMAX)
|
||||||
{
|
{
|
||||||
Size sz = std::tr1::get<0>(GetParam());
|
Size sz = std::tr1::get<0>(GetParam());
|
||||||
int type = std::tr1::get<1>(GetParam());
|
int type = std::tr1::get<1>(GetParam());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user