Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
848a476d
Commit
848a476d
authored
Sep 08, 2023
by
umang yadav
Browse files
fix tidy
parent
8e980f33
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
18 deletions
+9
-18
src/generate_root_modules.cpp
src/generate_root_modules.cpp
+4
-10
src/program.cpp
src/program.cpp
+5
-8
No files found.
src/generate_root_modules.cpp
View file @
848a476d
...
...
@@ -141,17 +141,15 @@ struct auto_gen_root_modules
std
::
cout
<<
"
\n
"
;
}
if
(
ins
->
name
()
==
"@return"
)
{
generate_run_on_target_modules
(
mm
,
p
,
ins
,
current_tid
);
}
// skip all params, literal and builtins other than return, skip "run_on_target_mod"
// ins
else
if
(
starts_with
(
ins
->
name
(),
"@"
)
or
skip_ins
.
count
(
ins
)
!=
0
)
if
((
starts_with
(
ins
->
name
(),
"@"
)
and
ins
->
name
()
!=
"@return"
)
or
skip_ins
.
count
(
ins
)
!=
0
)
{
continue
;
}
else
if
(
tass
.
find
(
ins
)
==
tass
.
end
())
else
if
(
ins
->
name
()
==
"@return"
or
tass
.
find
(
ins
)
==
tass
.
end
()
or
tass
.
at
(
ins
)
!=
current_tid
)
{
generate_run_on_target_modules
(
mm
,
p
,
ins
,
current_tid
);
}
...
...
@@ -167,10 +165,6 @@ struct auto_gen_root_modules
same_tid_ins_vec
.
push_back
(
ins
);
same_tid_ins_set
.
insert
(
ins
);
}
else
if
(
tass
.
at
(
ins
)
!=
current_tid
)
{
generate_run_on_target_modules
(
mm
,
p
,
ins
,
current_tid
);
}
else
{
MIGRAPHX_THROW
(
"Partition: this case shouldn't occur"
);
...
...
src/program.cpp
View file @
848a476d
...
...
@@ -187,7 +187,7 @@ target_assignments program::get_target_assignments(const std::vector<target>& ta
{
const
auto
metric
=
options
.
metric
;
target_assignments
p
;
target_assignments
tass
;
const
auto
*
mm
=
get_main_module
();
std
::
vector
<
std
::
pair
<
std
::
size_t
,
supported_segments
>>
target_subgraphs
;
...
...
@@ -196,12 +196,11 @@ target_assignments program::get_target_assignments(const std::vector<target>& ta
std
::
transform
(
tr
.
begin
(),
tr
.
end
(),
std
::
back_inserter
(
target_subgraphs
),
[
&
](
auto
tid
)
{
return
std
::
make_pair
(
tid
,
targets
[
tid
].
find_supported
(
mm
,
metric
));
});
for
(
const
auto
ins
:
iterator_for
(
*
mm
))
{
if
(
contains
(
p
,
ins
))
{
if
(
contains
(
tass
,
ins
))
continue
;
}
for
(
const
auto
&
[
tid
,
subgraph
]
:
target_subgraphs
)
{
...
...
@@ -211,17 +210,15 @@ target_assignments program::get_target_assignments(const std::vector<target>& ta
{
const
auto
&
instructions
=
segment
.
instructions
;
if
(
contains
(
instructions
,
ins
))
{
std
::
transform
(
instructions
.
begin
(),
instructions
.
end
(),
std
::
inserter
(
p
,
p
.
end
()),
std
::
inserter
(
tass
,
tass
.
end
()),
[
&
](
auto
instr
)
{
return
std
::
make_pair
(
instr
,
t
);
});
}
}
}
}
return
p
;
return
tass
;
}
bool
program
::
is_compiled
()
const
{
return
not
this
->
impl
->
contexts
.
empty
();
}
...
...
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