Skip to content

G-API: GOpaque implementation - #16118

Merged
alalek merged 8 commits into
opencv:masterfrom
smirnov-alexey:as/gopaque
Jan 30, 2020
Merged

alalek merged 8 commits into
opencv:masterfrom
smirnov-alexey:as/gopaque

Conversation

@smirnov-alexey

@smirnov-alexey smirnov-alexey commented Dec 10, 2019 •

Copy link
Copy Markdown
Contributor

This pullrequest adds a new type in G-API - GOpaque which is designed to store a single custom user type.

Currently it's almost copypasted GArray except other internal types are not related to vector.

build_gapi_standalone:Linux x64=ade-0.1.1f
build_gapi_standalone:Win64=ade-0.1.1f
build_gapi_standalone:Mac=ade-0.1.1f
build_gapi_standalone:Linux x64 Debug=ade-0.1.1f

force_builders=Custom,Custom Win,ARMv7
buildworker:Custom=linux-1
#build_image:Custom=ubuntu-clang:18.04
build_image:Custom=centos:7
build_contrib:Custom=OFF

@smirnov-alexey

Copy link
Copy Markdown
Contributor Author

@TolyaTalamanov, @AsyaPronina, @anton-potapov. Any feedback is appreciated

@smirnov-alexey

Copy link
Copy Markdown
Contributor Author

Adding GOpaque to variant broke the ABI

@alalek

alalek commented Dec 16, 2019

Copy link
Copy Markdown
Member

Removed Symbols 121

Unfortunately there is no reliable way to maintain ABI checker for G-API anymore.
We need to define long term solution.

@smirnov-alexey smirnov-alexey changed the title WIP: G-API: GOpaque implementation G-API: GOpaque implementation Dec 26, 2019
@smirnov-alexey

Copy link
Copy Markdown
Contributor Author

@rgarnov, @AsyaPronina, @TolyaTalamanov, please, review. As discussed with @dmatveev, 'copypaste' of GArray is OK for now, so it can be reviewed and merged.

Comment thread modules/gapi/test/gapi_opaque_tests.cpp Resolved

@dmatveev dmatveev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very well done!

Comment thread modules/gapi/test/gapi_opaque_tests.cpp Resolved
Comment thread modules/gapi/test/gapi_opaque_tests.cpp Resolved

@dmatveev dmatveev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, thanks!

@dmatveev

Copy link
Copy Markdown
Contributor

Unfortunately there is no reliable way to maintain ABI checker for G-API anymore.
We need to define long term solution.

@alalek I thought ABI compatibility requirements were relaxed already since 4.0?

@alalek

alalek commented Jan 13, 2020

Copy link
Copy Markdown
Member

We use "ABI checker" tool in "source" compatibility mode for OpenCV 4.x. OpenCV 3.4 uses full binary/source checks.

@dmatveev

Copy link
Copy Markdown
Contributor

@alalek

alalek commented Jan 27, 2020 •

Copy link
Copy Markdown
Member

There is some issue with ARMv7 builder (GCC 4.8). My guess, it is related to unique_ptr.

OpaqueRef() = default;
template<typename T> explicit OpaqueRef(const T& obj) : m_ref(new OpaqueRefT<T>(obj)) {}
template<typename T> explicit OpaqueRef( T& obj) : m_ref(new OpaqueRefT<T>(obj)) {}
template<typename T> explicit OpaqueRef( T&& obj) : m_ref(new OpaqueRefT<T>(obj)) {}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removal of T&& case + adding specialization for WrapValue<cv::detail::OpaqueRef> helps with compilation on GCC 4.8

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removal of T&&

You may try std::remove_reference instead:

        template<typename T> explicit OpaqueRef(const typename std::remove_reference<T>::type&  obj) : m_ref(new OpaqueRefT<T>(obj)) {}
        template<typename T> explicit OpaqueRef(      typename std::remove_reference<T>::type&  obj) : m_ref(new OpaqueRefT<T>(obj)) {}
        template<typename T> explicit OpaqueRef(      typename std::remove_reference<T>::type&& obj) : m_ref(new OpaqueRefT<T>(obj)) {}

Error message
build/precommit_armv7/opencv/modules/gapi/include/opencv2/gapi/util/any.hpp:69:59: error: call of overloaded 'OpaqueRef(cv::detail::OpaqueRef&)' is ambiguous
          holder_impl(arg_t&& a) : v(std::forward<arg_t>(a)) {}
                                                           ^
/build/precommit_armv7/opencv/modules/gapi/include/opencv2/gapi/util/any.hpp:69:59: note: candidates are:
In file included from /build/precommit_armv7/opencv/modules/gapi/include/opencv2/gapi/garg.hpp:23:0,
                 from /build/precommit_armv7/opencv/modules/gapi/include/opencv2/gapi/gcall.hpp:11,
                 from /build/precommit_armv7/opencv/modules/gapi/include/opencv2/gapi/gkernel.hpp:20,
                 from /build/precommit_armv7/opencv/modules/gapi/include/opencv2/gapi/core.hpp:19,
                 from /build/precommit_armv7/opencv/modules/gapi/src/precomp.hpp:14,
                 from /build/precommit_armv7/opencv/modules/gapi/src/backends/cpu/gcpubackend.cpp:8:
/build/precommit_armv7/opencv/modules/gapi/include/opencv2/gapi/gopaque.hpp:222:39: note: cv::detail::OpaqueRef::OpaqueRef(T&&) [with T = cv::detail::OpaqueRef&]
         template<typename T> explicit OpaqueRef(      T&& obj) : m_ref(new OpaqueRefT<T>(obj)) {}
                                       ^
/build/precommit_armv7/opencv/modules/gapi/include/opencv2/gapi/gopaque.hpp:221:39: note: cv::detail::OpaqueRef::OpaqueRef(T&) [with T = cv::detail::OpaqueRef]
         template<typename T> explicit OpaqueRef(      T&  obj) : m_ref(new OpaqueRefT<T>(obj)) {}
                                       ^
/build/precommit_armv7/opencv/modules/gapi/include/opencv2/gapi/gopaque.hpp:220:39: note: cv::detail::OpaqueRef::OpaqueRef(const T&) [with T = cv::detail::OpaqueRef]
         template<typename T> explicit OpaqueRef(const T&  obj) : m_ref(new OpaqueRefT<T>(obj)) {}
                                       ^
/build/precommit_armv7/opencv/modules/gapi/include/opencv2/gapi/gopaque.hpp:209:11: note: cv::detail::OpaqueRef::OpaqueRef(const cv::detail::OpaqueRef&)
     class OpaqueRef
           ^

@alalek
alalek merged commit 0d456f9 into opencv:master Jan 30, 2020
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
G-API: GOpaque implementation

* Stub initial copypasted solution

* Fix mov test and add a couple of others

* Fix warnings

* More code coverage and tests

* fix macos warning

* address review comments

* Address review comments and fix indentation

* Fix build on armv7
SavyaSanchi-Sharma pushed a commit to SavyaSanchi-Sharma/opencv that referenced this pull request Jul 30, 2026
G-API: GOpaque implementation

* Stub initial copypasted solution

* Fix mov test and add a couple of others

* Fix warnings

* More code coverage and tests

* fix macos warning

* address review comments

* Address review comments and fix indentation

* Fix build on armv7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants