Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / fluid / modules / gapi / test / gpu / gapi_operators_tests_gpu.cpp
1 // This file is part of OpenCV project.
2 // It is subject to the license terms in the LICENSE file found in the top-level directory
3 // of this distribution and at http://opencv.org/license.html.
4 //
5 // Copyright (C) 2018-2019 Intel Corporation
6
7
8 #include "../test_precomp.hpp"
9 #include "../common/gapi_operators_tests.hpp"
10
11 #define CORE_GPU cv::gapi::core::gpu::kernels()
12
13 namespace opencv_test
14 {
15
16
17 INSTANTIATE_TEST_CASE_P(MathOperatorTestGPU, MathOperatorMatMatTest,
18                     Combine(Values(Tolerance_FloatRel_IntAbs(1e-5, 2).to_compare_f()),
19                             Values( opPlusM, opMinusM, opDivM,
20                                     opGreater, opLess, opGreaterEq, opLessEq, opEq, opNotEq),
21                             Values(CV_8UC1, CV_16SC1, CV_32FC1),
22                             Values(cv::Size(1280, 720),
23                                cv::Size(640, 480),
24                                cv::Size(128, 128)),
25                             Values(-1, CV_8U, CV_32F),
26 /*init output matrices or not*/ testing::Bool(),
27                             Values(cv::compile_args(CORE_GPU))));
28
29 INSTANTIATE_TEST_CASE_P(MathOperatorTestGPU, MathOperatorMatScalarTest,
30                         Combine(Values(Tolerance_FloatRel_IntAbs(1e-4, 2).to_compare_f()),
31                                 Values( opPlus, opPlusR, opMinus, opMinusR, opMul, opMulR,  // FIXIT avoid division by values near zero: opDiv, opDivR,
32                                         opGT, opLT, opGE, opLE, opEQ, opNE,
33                                         opGTR, opLTR, opGER, opLER, opEQR, opNER),
34                                 Values(CV_8UC1, CV_16SC1, CV_32FC1),
35                                 Values(cv::Size(1280, 720),
36                                        cv::Size(640, 480),
37                                        cv::Size(128, 128)),
38                                 Values(-1, CV_8U, CV_32F),
39 /*init output matrices or not*/ testing::Bool(),
40                                 Values(cv::compile_args(CORE_GPU))));
41
42 INSTANTIATE_TEST_CASE_P(BitwiseOperatorTestGPU, MathOperatorMatMatTest,
43                         Combine(Values(AbsExact().to_compare_f()),
44                                 Values( opAnd, opOr, opXor ),
45                                 Values(CV_8UC1, CV_16UC1, CV_16SC1),
46                                 Values(cv::Size(1280, 720),
47                                    cv::Size(640, 480),
48                                    cv::Size(128, 128)),
49                                 Values(-1),
50 /*init output matrices or not*/ testing::Bool(),
51                                 Values(cv::compile_args(CORE_GPU))));
52
53 INSTANTIATE_TEST_CASE_P(BitwiseOperatorTestGPU, MathOperatorMatScalarTest,
54                         Combine(Values(AbsExact().to_compare_f()),
55                                 Values( opAND, opOR, opXOR, opANDR, opORR, opXORR ),
56                                 Values(CV_8UC1, CV_16UC1, CV_16SC1),
57                                 Values(cv::Size(1280, 720),
58                                        cv::Size(640, 480),
59                                        cv::Size(128, 128)),
60                                 Values(-1),
61 /*init output matrices or not*/ testing::Bool(),
62                                 Values(cv::compile_args(CORE_GPU))));
63
64 INSTANTIATE_TEST_CASE_P(BitwiseNotOperatorTestGPU, NotOperatorTest,
65                         Combine(Values(CV_8UC1, CV_16UC1, CV_16SC1),
66                                 Values(cv::Size(1280, 720),
67                                        cv::Size(640, 480),
68                                        cv::Size(128, 128)),
69 /*init output matrices or not*/ testing::Bool(),
70                                 Values(cv::compile_args(CORE_GPU))));
71 }