Skip to content

Support queue capacity as graph compilation argument#20119

Merged
alalek merged 4 commits intoopencv:masterfrom
TolyaTalamanov:at/compile-arg-for-queue-capacity
May 24, 2021
Merged

Support queue capacity as graph compilation argument#20119
alalek merged 4 commits intoopencv:masterfrom
TolyaTalamanov:at/compile-arg-for-queue-capacity

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
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.3.0
build_image:Custom Mac=openvino-2021.3.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 TolyaTalamanov requested a review from dmatveev May 19, 2021 06:52
@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

@dmatveev Have a look, please

* fetch next frame while current is being processed. This compilation argument
* specifies the capacity of this queue.
*/
struct queue_capacity
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.

OpenCV uses CamelCase for structures/classes/enum types.

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.

yes and so we do, but for some reason the graph compile arguments were started as snake_case (probably, unintentionally) so we follow it there now.

It is worth aligning in scope of 5.0 I believe.

@dmatveev dmatveev self-assigned this May 19, 2021
@dmatveev dmatveev added this to the 4.5.3 milestone May 19, 2021
* fetch next frame while current is being processed. This compilation argument
* specifies the capacity of this queue.
*/
struct queue_capacity
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.

yes and so we do, but for some reason the graph compile arguments were started as snake_case (probably, unintentionally) so we follow it there now.

It is worth aligning in scope of 5.0 I believe.

@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

@dmatveev

struct GAPI_Streaming: public ::testing::TestWithParam<KernelPackage> {
GAPI_Streaming() { initTestDataPath(); }
struct GAPI_Streaming: public ::testing::TestWithParam<std::tuple<KernelPackage,
cv::optional<size_t>>> {
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.

BTW optional doesn't print properly, It prints 0 if doesn't contain value.

I've tried to implement operator<< as for KernelPackage but it doesn't work :(

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.

Can you just use compile_args? += should work for those.

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.

What this compile_args should contain ? I guess queue_capacity and GKernelPackage.

But for SmokeTest_AutoMeta_VideoArray need to exclude GKernelPackage and use cv::gapi::kernels<TypesTest::OCVAddV>() instead

@TolyaTalamanov TolyaTalamanov force-pushed the at/compile-arg-for-queue-capacity branch from ca4d109 to 4c65c27 Compare May 24, 2021 09:25
Copy link
Copy Markdown
Contributor

@dmatveev dmatveev left a comment

Choose a reason for hiding this comment

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

Go ahead with merge. Thanks.

@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

@alalek

@alalek alalek merged commit b67c0e5 into opencv:master May 24, 2021
@alalek alalek mentioned this pull request Jun 4, 2021
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
…r-queue-capacity

* Support queue capacity as graph compilation argument

* Fix comments to review

* Fix comments to review

* Fix comments to review
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.

3 participants