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
9a202c15
Commit
9a202c15
authored
Mar 19, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14090 from andrey-golubev:gapi_unused_node_fluid_fix
parents
e783e667
dd2823aa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
gfluidbackend.cpp
modules/gapi/src/backends/fluid/gfluidbackend.cpp
+14
-0
gapi_fluid_test.cpp
modules/gapi/test/gapi_fluid_test.cpp
+15
-0
No files found.
modules/gapi/src/backends/fluid/gfluidbackend.cpp
View file @
9a202c15
...
...
@@ -1399,6 +1399,20 @@ void GFluidBackendImpl::addBackendPasses(ade::ExecutionEngineSetupContext &ectx)
// will be copied by views on each iteration and base our choice
// on this criteria)
auto
readers
=
node
->
outNodes
();
// There can be a situation when __internal__ nodes produced as part of some
// operation are unused later in the graph:
//
// in -> OP1
// |------> internal_1 // unused node
// |------> internal_2 -> OP2
// |------> out
//
// To allow graphs like the one above, skip nodes with empty outNodes()
if
(
readers
.
empty
())
{
continue
;
}
const
auto
&
candidate
=
ade
::
util
::
find_if
(
readers
,
[
&
](
ade
::
NodeHandle
nh
)
{
return
fg
.
metadata
(
nh
).
contains
<
FluidUnit
>
()
&&
fg
.
metadata
(
nh
).
get
<
FluidUnit
>
().
border_size
==
fd
.
border_size
;
...
...
modules/gapi/test/gapi_fluid_test.cpp
View file @
9a202c15
...
...
@@ -752,4 +752,19 @@ INSTANTIATE_TEST_CASE_P(Fluid, NV12RoiTest,
,
std
::
make_pair
(
cv
::
Size
{
1920
,
1080
},
cv
::
Rect
{
0
,
710
,
1920
,
270
})
));
TEST
(
Fluid
,
UnusedNodeTest
)
{
cv
::
GMat
in
;
cv
::
GMat
a
,
b
,
c
,
d
;
std
::
tie
(
a
,
b
,
c
,
d
)
=
cv
::
gapi
::
split4
(
in
);
cv
::
GMat
out
=
cv
::
gapi
::
merge3
(
a
,
b
,
c
);
cv
::
Mat
in_mat
(
cv
::
Size
(
8
,
8
),
CV_8UC4
);
cv
::
Mat
out_mat
(
cv
::
Size
(
8
,
8
),
CV_8UC3
);
cv
::
GComputation
comp
(
cv
::
GIn
(
in
),
cv
::
GOut
(
out
));
ASSERT_NO_THROW
(
comp
.
apply
(
cv
::
gin
(
in_mat
),
cv
::
gout
(
out_mat
),
cv
::
compile_args
(
cv
::
gapi
::
core
::
fluid
::
kernels
())));
}
}
// namespace opencv_test
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