Path: blob/master/modules/gapi/perf/internal/gapi_compiler_perf_tests.cpp
16358 views
// This file is part of OpenCV project.1// It is subject to the license terms in the LICENSE file found in the top-level directory2// of this distribution and at http://opencv.org/license.html.3//4// Copyright (C) 2018 Intel Corporation567#include "perf_precomp.hpp"8#include "../../test/common/gapi_tests_common.hpp"9#include "../../src/backends/fluid/gfluidcore.hpp"1011namespace opencv_test12{13using namespace perf;1415class CompilerPerfTest : public TestPerfParams<tuple<cv::Size, MatType>> {};16PERF_TEST_P_(CompilerPerfTest, TestPerformance)17{18const auto params = GetParam();19Size sz = get<0>(params);20MatType type = get<1>(params);2122initMatsRandU(type, sz, type, false);2324// G-API code ////////////////////////////////////////////////////////////25cv::GMat in;26auto splitted = cv::gapi::split3(in);27auto add1 = cv::gapi::addC({1}, std::get<0>(splitted));28auto add2 = cv::gapi::addC({2}, std::get<1>(splitted));29auto add3 = cv::gapi::addC({3}, std::get<2>(splitted));30auto out = cv::gapi::merge3(add1, add2, add3);3132TEST_CYCLE()33{34cv::GComputation c(in, out);35c.apply(in_mat1, out_mat_gapi, cv::compile_args(cv::gapi::core::fluid::kernels()));36}3738SANITY_CHECK_NOTHING();39}4041INSTANTIATE_TEST_CASE_P(CompilerPerfTest, CompilerPerfTest,42Combine(Values(szSmall128, szVGA, sz720p, sz1080p),43Values(CV_8UC3)));4445} // namespace opencv_test464748