perf tests are added

pull/15236/head
Dmitry Budnikov 5 years ago
parent 290078e0d0
commit 6427744063
  1. 1
      modules/gapi/perf/common/gapi_core_perf_tests.hpp
  2. 34
      modules/gapi/perf/common/gapi_core_perf_tests_inl.hpp
  3. 5
      modules/gapi/perf/cpu/gapi_core_perf_tests_cpu.cpp
  4. 5
      modules/gapi/perf/gpu/gapi_core_perf_tests_gpu.cpp

@ -64,6 +64,7 @@ namespace opencv_test
class RemapPerfTest : public TestPerfParams<tuple<cv::Size, MatType, cv::GCompileArgs>> {};
class FlipPerfTest : public TestPerfParams<tuple<cv::Size, MatType, int, cv::GCompileArgs>> {};
class CropPerfTest : public TestPerfParams<tuple<cv::Size, MatType, cv::Rect, cv::GCompileArgs>> {};
class CopyPerfTest : public TestPerfParams<tuple<cv::Size, MatType, cv::GCompileArgs>> {};
class ConcatHorPerfTest : public TestPerfParams<tuple<cv::Size, MatType, cv::GCompileArgs>> {};
class ConcatHorVecPerfTest : public TestPerfParams<tuple<cv::Size, MatType, cv::GCompileArgs>> {};
class ConcatVertPerfTest : public TestPerfParams<tuple<cv::Size, MatType, cv::GCompileArgs>> {};

@ -1440,6 +1440,40 @@ PERF_TEST_P_(CropPerfTest, TestPerformance)
//------------------------------------------------------------------------------
PERF_TEST_P_(CopyPerfTest, TestPerformance)
{
cv::Size sz_in = get<0>(GetParam());
MatType type = get<1>(GetParam());
cv::GCompileArgs compile_args = get<2>(GetParam());
initMatrixRandU(type, sz_in, type, false);
cv::Size sz_out = sz_in;
// OpenCV code ///////////////////////////////////////////////////////////
cv::Mat(in_mat1).copyTo(out_mat_ocv);
// G-API code ////////////////////////////////////////////////////////////
cv::GMat in;
auto out = cv::gapi::copy(in);
cv::GComputation c(in, out);
// Warm-up graph engine:
c.apply(in_mat1, out_mat_gapi, std::move(compile_args));
TEST_CYCLE()
{
c.apply(in_mat1, out_mat_gapi, std::move(compile_args));
}
// Comparison ////////////////////////////////////////////////////////////
EXPECT_EQ(0, cv::norm(out_mat_ocv, out_mat_gapi, NORM_INF));
EXPECT_EQ(out_mat_gapi.size(), sz_out);
SANITY_CHECK_NOTHING();
}
//------------------------------------------------------------------------------
PERF_TEST_P_(ConcatHorPerfTest, TestPerformance)
{
cv::Size sz_out = get<0>(GetParam());

@ -227,6 +227,11 @@ INSTANTIATE_TEST_CASE_P(CropPerfTestCPU, CropPerfTest,
Values(cv::Rect(10, 8, 20, 35), cv::Rect(4, 10, 37, 50)),
Values(cv::compile_args(CORE_CPU))));
INSTANTIATE_TEST_CASE_P(CopyPerfTestCPU, CopyPerfTest,
Combine(Values(szSmall128, szVGA, sz720p, sz1080p),
Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
Values(cv::compile_args(CORE_CPU))));
INSTANTIATE_TEST_CASE_P(ConcatHorPerfTestCPU, ConcatHorPerfTest,
Combine(Values(szSmall128, szVGA, sz720p, sz1080p),
Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),

@ -226,6 +226,11 @@ INSTANTIATE_TEST_CASE_P(CropPerfTestGPU, CropPerfTest,
Values(cv::Rect(10, 8, 20, 35), cv::Rect(4, 10, 37, 50)),
Values(cv::compile_args(CORE_GPU))));
INSTANTIATE_TEST_CASE_P(CopyPerfTestGPU, CopyPerfTest,
Combine(Values( szSmall128, szVGA, sz720p, sz1080p ),
Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ),
Values(cv::compile_args(CORE_GPU))));
INSTANTIATE_TEST_CASE_P(ConcatHorPerfTestGPU, ConcatHorPerfTest,
Combine(Values( szSmall128, szVGA, sz720p, sz1080p ),
Values( CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1 ),

Loading…
Cancel
Save