mirror of
https://github.com/opencv/opencv.git
synced 2026-11-21 00:35:35 -06:00
Porting of perf tests extension from 4.x to 5.x - #30663 Following PRs are being ported: * #29908 * #29922 * #29972 No more changes are introduced. PR for opencv-extra: https://github.com/opencv/opencv_extra/pull/1458 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake
32 lines
757 B
C++
32 lines
757 B
C++
#include "perf_precomp.hpp"
|
|
|
|
namespace opencv_test
|
|
{
|
|
using namespace perf;
|
|
|
|
typedef tuple<MatType, int> MatType_Length_t;
|
|
typedef TestBaseWithParam<MatType_Length_t> MatType_Length;
|
|
|
|
PERF_TEST_P( MatType_Length, dot,
|
|
testing::Combine(
|
|
testing::Values( CV_8UC1, CV_8SC1, CV_16SC1, CV_16UC1, CV_32SC1, CV_32FC1, CV_64FC1 ),
|
|
testing::Values( 32, 64, 128, 256, 512, 1024 )
|
|
))
|
|
{
|
|
int type = get<0>(GetParam());
|
|
int size = get<1>(GetParam());
|
|
Mat a(size, size, type);
|
|
Mat b(size, size, type);
|
|
|
|
declare.in(a, b, WARMUP_RNG);
|
|
declare.time(100);
|
|
|
|
double product;
|
|
|
|
TEST_CYCLE_N(1000) product = a.dot(b);
|
|
|
|
SANITY_CHECK(product, 1e-6, ERROR_RELATIVE);
|
|
}
|
|
|
|
} // namespace
|