Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
15621532
Commit
15621532
authored
Dec 06, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16077 from dmatveev:dm/gapi_narg_combine
parents
774d28ef
ccf415c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
gkernel.hpp
modules/gapi/include/opencv2/gapi/gkernel.hpp
+22
-0
gapi_kernel_tests.cpp
modules/gapi/test/gapi_kernel_tests.cpp
+15
-0
No files found.
modules/gapi/include/opencv2/gapi/gkernel.hpp
View file @
15621532
...
...
@@ -537,8 +537,29 @@ namespace gapi {
/** @} */
// FYI - this function is already commented above
GAPI_EXPORTS
GKernelPackage
combine
(
const
GKernelPackage
&
lhs
,
const
GKernelPackage
&
rhs
);
/**
* @brief Combines multiple G-API kernel packages into one
*
* @overload
*
* This function successively combines the passed kernel packages using a right fold.
* Calling `combine(a, b, c)` is equal to `combine(a, combine(b, c))`.
*
* @return The resulting kernel package
*/
template
<
typename
...
Ps
>
GKernelPackage
combine
(
const
GKernelPackage
&
a
,
const
GKernelPackage
&
b
,
Ps
&&
...
rest
)
{
return
combine
(
a
,
combine
(
b
,
rest
...));
}
/** \addtogroup gapi_compile_args
* @{
*/
/**
* @brief cv::use_only() is a special combinator which hints G-API to use only
* kernels specified in cv::GComputation::compile() (and not to extend kernels available by
...
...
@@ -548,6 +569,7 @@ namespace gapi {
{
GKernelPackage
pkg
;
};
/** @} */
}
// namespace gapi
...
...
modules/gapi/test/gapi_kernel_tests.cpp
View file @
15621532
...
...
@@ -325,6 +325,21 @@ TEST(KernelPackage, Can_Use_Custom_Kernel)
compile
({
in_meta
,
in_meta
},
cv
::
compile_args
(
pkg
)));
}
TEST
(
KernelPackage
,
CombineMultiple
)
{
namespace
J
=
Jupiter
;
namespace
S
=
Saturn
;
auto
a
=
cv
::
gapi
::
kernels
<
J
::
Foo
>
();
auto
b
=
cv
::
gapi
::
kernels
<
J
::
Bar
>
();
auto
c
=
cv
::
gapi
::
kernels
<
S
::
Qux
>
();
auto
pkg
=
cv
::
gapi
::
combine
(
a
,
b
,
c
);
EXPECT_EQ
(
3u
,
pkg
.
size
());
EXPECT_TRUE
(
pkg
.
includes
<
J
::
Foo
>
());
EXPECT_TRUE
(
pkg
.
includes
<
J
::
Bar
>
());
EXPECT_TRUE
(
pkg
.
includes
<
S
::
Qux
>
());
}
TEST_F
(
HeteroGraph
,
Call_Custom_Kernel_Default_Backend
)
{
// in0 -> GCPUAdd -> tmp -> cpu::GClone -> GCPUBGR2Gray -> out
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment