mirror of
https://github.com/opencv/opencv.git
synced 2024-11-27 12:40:05 +08:00
f2fe6f40c2
* core: rework and optimize SIMD implementation of dotProd - add new universal intrinsics v_dotprod[int32], v_dotprod_expand[u&int8, u&int16, int32], v_cvt_f64(int64) - add a boolean param for all v_dotprod&_expand intrinsics that change the behavior of addition order between pairs in some platforms in order to reach the maximum optimization when the sum among all lanes is what only matters - fix clang build on ppc64le - support wide universal intrinsics for dotProd_32s - remove raw SIMD and activate universal intrinsics for dotProd_8 - implement SIMD optimization for dotProd_s16&u16 - extend performance test data types of dotprod - fix GCC VSX workaround of vec_mule and vec_mulo (in little-endian it must be swapped) - optimize v_mul_expand(int32) on VSX * core: remove boolean param from v_dotprod&_expand and implement v_dotprod_fast&v_dotprod_expand_fast this changes made depend on "terfendail" review
32 lines
747 B
C++
32 lines
747 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 ),
|
|
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
|