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
3c6d5aba
Commit
3c6d5aba
authored
Jan 24, 2019
by
Ruslan Garnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed fluid heterogeneity support
parent
631b2468
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
20 deletions
+30
-20
gfluidbackend.cpp
modules/gapi/src/backends/fluid/gfluidbackend.cpp
+30
-20
No files found.
modules/gapi/src/backends/fluid/gfluidbackend.cpp
View file @
3c6d5aba
...
...
@@ -930,9 +930,13 @@ namespace
{
// FIXME: ASSERT(DATA), ASSERT(FLUIDDATA)
auto
&
fd
=
fg
.
metadata
(
out_data_node
).
get
<
FluidData
>
();
fd
.
latency
=
out_latency
;
// If fluid node is external, it will be bound to a real image without
// fluid buffer allocation, so set its latency to 0 not to confuse later latency propagation.
// Latency is used in fluid buffer allocation process and is not used by the scheduler
// so latency doesn't affect the execution and setting it to 0 is legal
fd
.
latency
=
fd
.
internal
?
out_latency
:
0
;
fd
.
lpi_write
=
fu
.
k
.
m_lpi
;
GModel
::
log
(
g
,
out_data_node
,
"Latency: "
+
std
::
to_string
(
out_
latency
));
GModel
::
log
(
g
,
out_data_node
,
"Latency: "
+
std
::
to_string
(
fd
.
latency
));
}
}
}
...
...
@@ -1207,35 +1211,41 @@ void GFluidBackendImpl::addBackendPasses(ade::ExecutionEngineSetupContext &ectx)
for
(
const
auto
&
nh
:
gim
.
nodes
())
{
if
(
gim
.
metadata
(
nh
).
get
<
NodeKind
>
().
k
==
NodeKind
::
ISLAND
)
switch
(
gim
.
metadata
(
nh
).
get
<
NodeKind
>
().
k
)
{
case
NodeKind
:
:
ISLAND
:
{
const
auto
isl
=
gim
.
metadata
(
nh
).
get
<
FusedIsland
>
().
object
;
if
(
isl
->
backend
()
==
cv
::
gapi
::
fluid
::
backend
())
{
// add FluidData to all data nodes inside island
// Add FluidData to all data nodes inside island,
// set internal = true if node is not a slot in terms of higher-level GIslandModel
for
(
const
auto
node
:
isl
->
contents
())
{
if
(
g
.
metadata
(
node
).
get
<
NodeType
>
().
t
==
NodeType
::
DATA
)
if
(
g
.
metadata
(
node
).
get
<
NodeType
>
().
t
==
NodeType
::
DATA
&&
!
fg
.
metadata
(
node
).
contains
<
FluidData
>
())
setFluidData
(
node
,
true
);
}
// add FluidData to slot if it's read/written by fluid
std
::
vector
<
ade
::
NodeHandle
>
io_handles
;
for
(
const
auto
&
in_op
:
isl
->
in_ops
())
{
ade
::
util
::
copy
(
in_op
->
inNodes
(),
std
::
back_inserter
(
io_handles
));
}
for
(
const
auto
&
out_op
:
isl
->
out_ops
())
}
// if (fluid backend)
}
break
;
// case::ISLAND
case
NodeKind
:
:
SLOT
:
{
ade
::
util
::
copy
(
out_op
->
outNodes
(),
std
::
back_inserter
(
io_handles
));
}
for
(
const
auto
&
io_node
:
io_handles
)
// add FluidData to slot if it's read/written by fluid
// regardless if it is one fluid island (both writing to and reading from this object)
// or two distinct islands (both fluid)
auto
isFluidIsland
=
[
&
](
const
ade
::
NodeHandle
&
node
)
{
const
auto
isl
=
gim
.
metadata
(
node
).
get
<
FusedIsland
>
().
object
;
return
isl
->
backend
()
==
cv
::
gapi
::
fluid
::
backend
();
};
if
(
ade
::
util
::
any_of
(
ade
::
util
::
chain
(
nh
->
inNodes
(),
nh
->
outNodes
()),
isFluidIsland
))
{
if
(
!
fg
.
metadata
(
io_node
).
contains
<
FluidData
>
())
setFluidData
(
io
_node
,
false
);
auto
data_node
=
gim
.
metadata
(
nh
).
get
<
DataSlot
>
().
original_data_node
;
setFluidData
(
data
_node
,
false
);
}
}
// if (fluid backend)
}
// if (ISLAND)
}
break
;
// case::SLOT
default
:
GAPI_Assert
(
false
);
}
// switch
}
// for (gim.nodes())
});
// FIXME:
...
...
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