Merge pull request #18257 from OrestChura:oc/fluid_operator_bitwise_and_scalar
authorOrest Chura <orest.chura@intel.com>
Fri, 18 Sep 2020 13:44:47 +0000 (16:44 +0300)
committerGitHub <noreply@github.com>
Fri, 18 Sep 2020 13:44:47 +0000 (13:44 +0000)
commitd1cdef596c7018540cf68e709a2ba36a07ce46e0
tree0c17496aabc1531dae32e412092d130e940fd158
parent7163781639c5f18e61aeb1476ea2260299716eb3
Merge pull request #18257 from OrestChura:oc/fluid_operator_bitwise_and_scalar

[G-API]: Add Fluid bitwise operations implementation for (GMat, GScalar)

* Added Fluid `bitwise` with `Scalar` + acc.tests
 - simple loop implementation for Fluid used (no `hal`);
   - `Scalar` is casted to `int` in the beginning
 - tests just modified to work with `Scalar`
 - expected output in operators' tests fixed (operators can't change Mat's depth)
 - `float` `Scalar` `RNG` added, `RNG` reworked (`time` is used now), initialization of test fixtures reworked
   - if input or output is `float` Scalar is initialized by `float`
 - some problems with Fluid/OCV floating-point comparison difference stashed by `AbsSimilarPoints()` usage, FIXME added
 - divide-by-zero is now fixed differently and everywhere

* - Added perf_tests for bitwise_Scalar operations
 - due to errors of Fluid floating-point comparison operations, added support of different validation in Cmp perf_tests; added FIXME

 - reworked integral initialization of Scalar

* Addressing comments
 - NULL -> nullptr
 - Scalar convertion moved to the function
 - avoid -> avoiding

* Addressing comments

* CV_assert -> GAPI_assert

* Addressed DM comments
 - refactored convertScalarForBitwise()
 - removed unnecessary braces for switch

* Changed the operators tests
 - switch via `enum` implemented
 - infrastructure for that refactored
17 files changed:
modules/gapi/perf/common/gapi_core_perf_tests.hpp
modules/gapi/perf/common/gapi_core_perf_tests_inl.hpp
modules/gapi/perf/cpu/gapi_core_perf_tests_cpu.cpp
modules/gapi/perf/cpu/gapi_core_perf_tests_fluid.cpp
modules/gapi/perf/gpu/gapi_core_perf_tests_gpu.cpp
modules/gapi/src/backends/fluid/gfluidcore.cpp
modules/gapi/test/common/gapi_core_tests.hpp
modules/gapi/test/common/gapi_core_tests_inl.hpp
modules/gapi/test/common/gapi_operators_tests.hpp
modules/gapi/test/common/gapi_operators_tests_inl.hpp
modules/gapi/test/common/gapi_tests_common.hpp
modules/gapi/test/cpu/gapi_core_tests_cpu.cpp
modules/gapi/test/cpu/gapi_core_tests_fluid.cpp
modules/gapi/test/cpu/gapi_operators_tests_cpu.cpp
modules/gapi/test/cpu/gapi_operators_tests_fluid.cpp
modules/gapi/test/gpu/gapi_core_tests_gpu.cpp
modules/gapi/test/gpu/gapi_operators_tests_gpu.cpp