G-API: Fix G_TYPED_KERNEL_M macro#16221
Merged
alalek merged 5 commits intoopencv:masterfrom Jan 13, 2020
Merged
Conversation
Contributor
Author
79c4e11 to
fa81030
Compare
Contributor
Author
Contributor
Author
fa81030 to
e142a34
Compare
dmatveev
reviewed
Jan 9, 2020
Contributor
dmatveev
left a comment
There was a problem hiding this comment.
What about tests? If the code is compiled, assume the test is just passed :) (I believe we have such tests already with static_assert inside.
Would it work for cases when a kernel has multiple input parameters (not the output ones)? Worth adding to the test suite
dmatveev
reviewed
Jan 9, 2020
| // {body} is to be defined by user | ||
|
|
||
| #define GET_HELPER(_1, _2, _3, _4, _5, _6, NAME, ...) NAME | ||
| #define API(...) __VA_ARGS__ |
Contributor
There was a problem hiding this comment.
these names are too generic (especially API). I'd rename it to something more specific to avoild hardly-debuggable collisions
…-g_typed_kernel_m
f7ed5c4 to
8e18a13
Compare
TolyaTalamanov
commented
Jan 10, 2020
8e18a13 to
c426b9b
Compare
Contributor
Author
Contributor
|
Looks good to me |
Contributor
Author
dmatveev
approved these changes
Jan 13, 2020
Contributor
|
👍 thanks! |
a-sajjad72
pushed a commit
to a-sajjad72/opencv
that referenced
this pull request
Mar 30, 2023
…rnel_m G-API: Fix G_TYPED_KERNEL_M macro * Fix G_TYPED_KERNEL_M macro * Fixes * Fix windows build * Fix doxygen * Added several macros * Add overloads for G_TYPED_KERNEL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The following code does not compile
Workaround:
So, I think this isn't clear to the user
The problem is that preprocessor split
std::tuple<GMat, GMat>by 2 parameters:std::tuple<GMatandGMat>We pass 4 parameters to the macro instead of 3 in this caseSolution
I just added overload for
G_TYPED_KERNEL_Mfor 5 and 6 parameters and added assert if the number parameters of tuple greater than 4 (But now it's work only for 5 parameters)Of course it works on a limited number of parameters and it's not a perfect solution but I think it's better than it was