gapi_operators_tests_gpu.cpp 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 Intel Corporation
  6. #include "../test_precomp.hpp"
  7. #include "../common/gapi_operators_tests.hpp"
  8. namespace
  9. {
  10. #define CORE_GPU [] () { return cv::compile_args(cv::gapi::use_only{cv::gapi::core::gpu::kernels()}); }
  11. } // anonymous namespace
  12. namespace opencv_test
  13. {
  14. INSTANTIATE_TEST_CASE_P(MathOperatorTestGPU, MathOperatorMatMatTest,
  15. Combine(Values(CV_8UC1, CV_16SC1, CV_32FC1),
  16. Values(cv::Size(1280, 720),
  17. cv::Size(640, 480),
  18. cv::Size(128, 128)),
  19. Values(-1),
  20. Values(CORE_GPU),
  21. Values(Tolerance_FloatRel_IntAbs(1e-5, 2).to_compare_obj()),
  22. Values( ADD, SUB, DIV,
  23. GT, LT, GE, LE, EQ, NE)));
  24. INSTANTIATE_TEST_CASE_P(MathOperatorTestGPU, MathOperatorMatScalarTest,
  25. Combine(Values(CV_8UC1, CV_16SC1, CV_32FC1),
  26. Values(cv::Size(1280, 720),
  27. cv::Size(640, 480),
  28. cv::Size(128, 128)),
  29. Values(-1),
  30. Values(CORE_GPU),
  31. Values(Tolerance_FloatRel_IntAbs(1e-4, 2).to_compare_obj()),
  32. Values( ADD, SUB, MUL, DIV,
  33. ADDR, SUBR, MULR, DIVR,
  34. GT, LT, GE, LE, EQ, NE,
  35. GTR, LTR, GER, LER, EQR, NER)));
  36. INSTANTIATE_TEST_CASE_P(BitwiseOperatorTestGPU, MathOperatorMatMatTest,
  37. Combine(Values(CV_8UC1, CV_16UC1, CV_16SC1),
  38. Values(cv::Size(1280, 720),
  39. cv::Size(640, 480),
  40. cv::Size(128, 128)),
  41. Values(-1),
  42. Values(CORE_GPU),
  43. Values(AbsExact().to_compare_obj()),
  44. Values( AND, OR, XOR )));
  45. INSTANTIATE_TEST_CASE_P(BitwiseOperatorTestGPU, MathOperatorMatScalarTest,
  46. Combine(Values(CV_8UC1, CV_16UC1, CV_16SC1),
  47. Values(cv::Size(1280, 720),
  48. cv::Size(640, 480),
  49. cv::Size(128, 128)),
  50. Values(-1),
  51. Values(CORE_GPU),
  52. Values(AbsExact().to_compare_obj()),
  53. Values( AND, OR, XOR,
  54. ANDR, ORR, XORR )));
  55. INSTANTIATE_TEST_CASE_P(BitwiseNotOperatorTestGPU, NotOperatorTest,
  56. Combine(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. Values(CORE_GPU)));
  62. }