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
c8aea733
Commit
c8aea733
authored
Aug 31, 2023
by
umang yadav
Browse files
Paritioner is working
parent
89e71273
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
src/include/migraphx/op/if_op.hpp
src/include/migraphx/op/if_op.hpp
+3
-3
test/multi_target/multitarget_test.cpp
test/multi_target/multitarget_test.cpp
+7
-4
No files found.
src/include/migraphx/op/if_op.hpp
View file @
c8aea733
...
@@ -70,13 +70,13 @@ struct if_op
...
@@ -70,13 +70,13 @@ struct if_op
module_ref
mod
=
cond
?
mods
[
0
]
:
mods
[
1
];
module_ref
mod
=
cond
?
mods
[
0
]
:
mods
[
1
];
std
::
unordered_map
<
std
::
string
,
argument
>
params
;
std
::
unordered_map
<
std
::
string
,
argument
>
params
;
std
::
set
<
std
::
string
>
pnames
;
std
::
vector
<
std
::
string
>
pnames
;
for
(
const_module_ref
smod
:
mods
)
for
(
const_module_ref
smod
:
mods
)
{
{
auto
names
=
smod
->
get_parameter_names
();
auto
names
=
smod
->
get_parameter_names
();
pnames
.
insert
(
names
.
begin
(),
names
.
end
());
std
::
cout
<<
smod
->
name
()
<<
std
::
endl
;
pnames
.
insert
(
pnames
.
end
(),
names
.
begin
(),
names
.
end
());
}
}
assert
(
pnames
.
size
()
<
args
.
size
());
assert
(
pnames
.
size
()
<
args
.
size
());
std
::
transform
(
pnames
.
begin
(),
std
::
transform
(
pnames
.
begin
(),
pnames
.
end
(),
pnames
.
end
(),
...
...
test/multi_target/multitarget_test.cpp
View file @
c8aea733
...
@@ -532,9 +532,12 @@ TEST_CASE(multitarget_compile_nested_if_then_else_partition)
...
@@ -532,9 +532,12 @@ TEST_CASE(multitarget_compile_nested_if_then_else_partition)
auto
*
test_mod
=
prog
.
create_module
(
mod_name
);
auto
*
test_mod
=
prog
.
create_module
(
mod_name
);
std
::
vector
<
float
>
data
(
ds
.
elements
(),
-
1
);
std
::
vector
<
float
>
data
(
ds
.
elements
(),
-
1
);
auto
l1
=
test_mod
->
add_literal
(
migraphx
::
literal
(
ds
,
data
));
auto
l1
=
test_mod
->
add_literal
(
migraphx
::
literal
(
ds
,
data
));
auto
ins1
=
test_mod
->
add_instruction
(
migraphx
::
make_op
(
"add"
),
inputs
[
0
],
l1
);
auto
test_mod_param_0
=
test_mod
->
add_parameter
(
mod_name
+
"_param_0"
,
ds
);
auto
ins2
=
test_mod
->
add_instruction
(
migraphx
::
make_op
(
"mul"
),
ins1
,
inputs
[
1
]);
auto
test_mod_param_1
=
test_mod
->
add_parameter
(
mod_name
+
"_param_1"
,
ds
);
auto
ins3
=
test_mod
->
add_instruction
(
migraphx
::
make_op
(
"sub"
),
ins2
,
inputs
[
2
]);
auto
test_mod_param_2
=
test_mod
->
add_parameter
(
mod_name
+
"_param_2"
,
ds
);
auto
ins1
=
test_mod
->
add_instruction
(
migraphx
::
make_op
(
"add"
),
test_mod_param_0
,
l1
);
auto
ins2
=
test_mod
->
add_instruction
(
migraphx
::
make_op
(
"mul"
),
ins1
,
test_mod_param_1
);
auto
ins3
=
test_mod
->
add_instruction
(
migraphx
::
make_op
(
"sub"
),
ins2
,
test_mod_param_2
);
test_mod
->
add_return
({
ins3
});
test_mod
->
add_return
({
ins3
});
tass
.
insert
(
tass
.
begin
(),
std
::
make_pair
(
ins1
,
tid
));
tass
.
insert
(
tass
.
begin
(),
std
::
make_pair
(
ins1
,
tid
));
tass
.
insert
(
tass
.
begin
(),
std
::
make_pair
(
ins2
,
tid
));
tass
.
insert
(
tass
.
begin
(),
std
::
make_pair
(
ins2
,
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