Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
44369c8e
Commit
44369c8e
authored
Oct 19, 2023
by
Umang Yadav
Browse files
refactor
parent
d493b4ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
21 deletions
+6
-21
src/generate_root_modules.cpp
src/generate_root_modules.cpp
+6
-21
No files found.
src/generate_root_modules.cpp
View file @
44369c8e
...
...
@@ -149,14 +149,15 @@ struct auto_gen_root_modules
}
}
bool
is_different_subgraph
(
migraphx
::
instruction_ref
ins
,
bool
is_different_subgraph
(
migraphx
::
instruction_ref
current_
ins
,
std
::
optional
<
std
::
size_t
>
previous_tid
)
{
if
(
tass
.
find
(
ins
)
==
tass
.
end
())
if
(
tass
.
find
(
current_
ins
)
==
tass
.
end
())
{
return
previous_tid
.
has_value
();
}
return
tass
.
at
(
ins
)
!=
previous_tid
.
value_or
(
std
::
numeric_limits
<
std
::
size_t
>::
max
());
return
tass
.
at
(
current_ins
)
!=
previous_tid
.
value_or
(
std
::
numeric_limits
<
std
::
size_t
>::
max
());
}
/*
...
...
@@ -178,15 +179,7 @@ struct auto_gen_root_modules
return
false
;
}
return
std
::
any_of
(
inputs
.
begin
(),
inputs
.
end
(),
[
&
](
auto
input_ins
)
{
if
(
tass
.
find
(
input_ins
)
==
tass
.
end
())
{
return
ins_tid
.
has_value
();
}
else
{
return
tass
.
at
(
input_ins
)
!=
ins_tid
.
value_or
(
std
::
numeric_limits
<
std
::
size_t
>::
max
());
}
return
is_different_subgraph
(
input_ins
,
ins_tid
);
});
}
...
...
@@ -208,15 +201,7 @@ struct auto_gen_root_modules
return
false
;
}
return
std
::
any_of
(
outputs
.
begin
(),
outputs
.
end
(),
[
&
](
auto
output_ins
)
{
if
(
tass
.
find
(
output_ins
)
==
tass
.
end
())
{
return
ins_tid
.
has_value
();
}
else
{
return
tass
.
at
(
output_ins
)
!=
ins_tid
.
value_or
(
std
::
numeric_limits
<
std
::
size_t
>::
max
());
};
return
is_different_subgraph
(
output_ins
,
ins_tid
);
});
}
...
...
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