Skip to content

[G-API] Validate RMat adapter in executor#20572

Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom
TolyaTalamanov:at/check-adapter-in-executor
Aug 20, 2021
Merged

[G-API] Validate RMat adapter in executor#20572
opencv-pushbot merged 1 commit intoopencv:masterfrom
TolyaTalamanov:at/check-adapter-in-executor

Conversation

@TolyaTalamanov
Copy link
Copy Markdown
Contributor

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

Build configuration

force_builders=Custom,Custom Win,Custom Mac
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

Xbuild_image:Custom=centos:7
Xbuildworker:Custom=linux-1
build_gapi_standalone:Custom=ade-0.1.1f

build_image:Custom=ubuntu-openvino-2021.3.0:20.04
build_image:Custom Win=openvino-2021.2.0
build_image:Custom Mac=openvino-2021.2.0

test_modules:Custom=gapi,python2,python3,java
test_modules:Custom Win=gapi,python2,python3,java
test_modules:Custom Mac=gapi,python2,python3,java

buildworker:Custom=linux-1
# disabled due high memory usage: test_opencl:Custom=ON
test_opencl:Custom=OFF
test_bigdata:Custom=1
test_filter:Custom=*

@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

@rgarnov Could you have a look ?

auto mag_data = rmat.get<RMatAdapter>()->data();
if (out_mat.data != mag_data) {
auto* adapter = rmat.get<RMatAdapter>();
if (adapter != nullptr && out_mat.data != adapter->data()) {
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.

adapter != nullptr

Should this to be an assertion with raised exception in case of null?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No
adapter == nullptr is a normal case.
We need to do copy only if adapter is RMatAdapter and out_mat.data != adapter->data()

@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

@rgarnov Could you have a look, please ?

@opencv-pushbot opencv-pushbot merged commit bb5f33d into opencv:master Aug 20, 2021
@alalek alalek mentioned this pull request Oct 15, 2021
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