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
e569e9dc
Commit
e569e9dc
authored
Feb 04, 2020
by
Andrey Golubev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unify G_TYPED_KERNEL and G_TYPED_KERNEL_M
parent
57c99914
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
36 deletions
+19
-36
gkernel.hpp
modules/gapi/include/opencv2/gapi/gkernel.hpp
+19
-19
infer.hpp
modules/gapi/include/opencv2/gapi/infer.hpp
+0
-17
No files found.
modules/gapi/include/opencv2/gapi/gkernel.hpp
View file @
e569e9dc
...
@@ -228,6 +228,20 @@ public:
...
@@ -228,6 +228,20 @@ public:
}
}
};
};
namespace
detail
{
// This tiny class eliminates the semantic difference between
// GKernelType and GKernelTypeM.
template
<
typename
,
typename
>
class
KernelTypeMedium
;
template
<
typename
K
,
typename
...
R
,
typename
...
Args
>
class
KernelTypeMedium
<
K
,
std
::
function
<
std
::
tuple
<
R
...
>
(
Args
...)
>>
:
public
cv
::
GKernelTypeM
<
K
,
std
::
function
<
std
::
tuple
<
R
...
>
(
Args
...)
>>
{};
template
<
typename
K
,
typename
R
,
typename
...
Args
>
class
KernelTypeMedium
<
K
,
std
::
function
<
R
(
Args
...)
>>
:
public
cv
::
GKernelType
<
K
,
std
::
function
<
R
(
Args
...)
>>
{};
}
// namespace detail
}
// namespace cv
}
// namespace cv
...
@@ -256,12 +270,12 @@ public:
...
@@ -256,12 +270,12 @@ public:
*
*
* @param Class type name for this operation.
* @param Class type name for this operation.
* @param API an `std::function<>`-like signature for the operation;
* @param API an `std::function<>`-like signature for the operation;
*
return type is a single value
.
*
return type is a single value or a tuple of multiple values
.
* @param Id string identifier for the operation. Must be unique.
* @param Id string identifier for the operation. Must be unique.
*/
*/
#define G_TYPED_KERNEL_HELPER(Class, API, Id) \
#define G_TYPED_KERNEL_HELPER(Class, API, Id) \
G_ID_HELPER_BODY(Class, Id) \
G_ID_HELPER_BODY(Class, Id) \
struct Class final: public cv::
GKernelType<Class, std::function API >,
\
struct Class final: public cv::
detail::KernelTypeMedium<Class, std::function API >,
\
public G_ID_HELPER_CLASS(Class)
public G_ID_HELPER_CLASS(Class)
// {body} is to be defined by user
// {body} is to be defined by user
...
@@ -319,10 +333,7 @@ G_TYPED_KERNEL_HELPER(Class, COMBINE_SIGNATURE(_1, _2, _3, _4, _5, _6, _7, _8, _
...
@@ -319,10 +333,7 @@ G_TYPED_KERNEL_HELPER(Class, COMBINE_SIGNATURE(_1, _2, _3, _4, _5, _6, _7, _8, _
* return type is a tuple of multiple values.
* return type is a tuple of multiple values.
* @param Id string identifier for the operation. Must be unique.
* @param Id string identifier for the operation. Must be unique.
*/
*/
#define G_TYPED_KERNEL_M_HELPER(Class, API, Id) \
#define G_TYPED_KERNEL_M_HELPER G_TYPED_KERNEL_HELPER
G_ID_HELPER_BODY(Class, Id) \
struct Class final: public cv::GKernelTypeM<Class, std::function API >, \
public G_ID_HELPER_CLASS(Class)
// {body} is to be defined by user
// {body} is to be defined by user
#define G_TYPED_KERNEL_M_HELPER_2(Class, _1, _2, Id) \
#define G_TYPED_KERNEL_M_HELPER_2(Class, _1, _2, Id) \
...
@@ -358,21 +369,10 @@ G_TYPED_KERNEL_HELPER(Class, COMBINE_SIGNATURE(_1, _2, _3, _4, _5, _6, _7, _8, _
...
@@ -358,21 +369,10 @@ G_TYPED_KERNEL_HELPER(Class, COMBINE_SIGNATURE(_1, _2, _3, _4, _5, _6, _7, _8, _
*
*
* @param Class type name for this operation.
* @param Class type name for this operation.
*/
*/
#define G_TYPED_KERNEL_M(Class, ...) __WRAP_VAARGS(GET_G_TYPED_KERNEL(__VA_ARGS__, \
#define G_TYPED_KERNEL_M G_TYPED_KERNEL
G_TYPED_KERNEL_M_HELPER_10, \
G_TYPED_KERNEL_M_HELPER_9, \
G_TYPED_KERNEL_M_HELPER_8, \
G_TYPED_KERNEL_M_HELPER_7, \
G_TYPED_KERNEL_M_HELPER_6, \
G_TYPED_KERNEL_M_HELPER_5, \
G_TYPED_KERNEL_M_HELPER_4, \
G_TYPED_KERNEL_M_HELPER_3, \
G_TYPED_KERNEL_M_HELPER_2, \
G_TYPED_KERNEL_M_HELPER)(Class, __VA_ARGS__)) \
// {body} is to be defined by user
#define G_API_OP G_TYPED_KERNEL
#define G_API_OP G_TYPED_KERNEL
#define G_API_OP_M G_
TYPED_KERNEL_M
#define G_API_OP_M G_
API_OP
namespace
cv
namespace
cv
{
{
...
...
modules/gapi/include/opencv2/gapi/infer.hpp
View file @
e569e9dc
...
@@ -23,23 +23,6 @@
...
@@ -23,23 +23,6 @@
namespace
cv
{
namespace
cv
{
namespace
detail
{
// This tiny class eliminates the semantic difference between
// GKernelType and GKernelTypeM.
// FIXME: Something similar can be reused for regular kernels
template
<
typename
,
typename
>
struct
KernelTypeMedium
;
template
<
class
K
,
typename
...
R
,
typename
...
Args
>
struct
KernelTypeMedium
<
K
,
std
::
function
<
std
::
tuple
<
R
...
>
(
Args
...)
>
>:
public
GKernelTypeM
<
K
,
std
::
function
<
std
::
tuple
<
R
...
>
(
Args
...)
>
>
{};
template
<
class
K
,
typename
R
,
typename
...
Args
>
struct
KernelTypeMedium
<
K
,
std
::
function
<
R
(
Args
...)
>
>:
public
GKernelType
<
K
,
std
::
function
<
R
(
Args
...)
>
>
{};
}
// namespace detail
template
<
typename
,
typename
>
class
GNetworkType
;
template
<
typename
,
typename
>
class
GNetworkType
;
// TODO: maybe tuple_wrap_helper from util.hpp may help with this.
// TODO: maybe tuple_wrap_helper from util.hpp may help with this.
...
...
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