Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Tetragramm
GitHub Repository: Tetragramm/opencv
Path: blob/master/modules/core/perf/perf_dot.cpp
16354 views
1
#include "perf_precomp.hpp"
2
3
namespace opencv_test
4
{
5
using namespace perf;
6
7
typedef tuple<MatType, int> MatType_Length_t;
8
typedef TestBaseWithParam<MatType_Length_t> MatType_Length;
9
10
PERF_TEST_P( MatType_Length, dot,
11
testing::Combine(
12
testing::Values( CV_8UC1, CV_32SC1, CV_32FC1 ),
13
testing::Values( 32, 64, 128, 256, 512, 1024 )
14
))
15
{
16
int type = get<0>(GetParam());
17
int size = get<1>(GetParam());
18
Mat a(size, size, type);
19
Mat b(size, size, type);
20
21
declare.in(a, b, WARMUP_RNG);
22
declare.time(100);
23
24
double product;
25
26
TEST_CYCLE_N(1000) product = a.dot(b);
27
28
SANITY_CHECK(product, 1e-6, ERROR_RELATIVE);
29
}
30
31
} // namespace
32
33