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
5de36e4a
Commit
5de36e4a
authored
Feb 20, 2023
by
charlie
Browse files
Tidy fixes
parent
b21d8118
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
9 deletions
+9
-9
src/include/migraphx/op/select_module.hpp
src/include/migraphx/op/select_module.hpp
+2
-2
src/targets/gpu/lowering.cpp
src/targets/gpu/lowering.cpp
+1
-1
test/ref_ops_test.cpp
test/ref_ops_test.cpp
+3
-3
test/verify/test_select_module_add.cpp
test/verify/test_select_module_add.cpp
+1
-1
test/verify/test_select_module_reduce.cpp
test/verify/test_select_module_reduce.cpp
+2
-2
No files found.
src/include/migraphx/op/select_module.hpp
View file @
5de36e4a
...
@@ -43,7 +43,7 @@ struct select_module
...
@@ -43,7 +43,7 @@ struct select_module
std
::
string
name
()
const
{
return
"select_module"
;
}
std
::
string
name
()
const
{
return
"select_module"
;
}
shape
compute_shape
(
const
std
::
vector
<
shape
>&
,
std
::
vector
<
module_ref
>
)
const
shape
compute_shape
(
const
std
::
vector
<
shape
>&
,
const
std
::
vector
<
module_ref
>
&
)
const
{
{
return
shape
{
output_dyn_shapes
};
return
shape
{
output_dyn_shapes
};
}
}
...
@@ -72,7 +72,7 @@ struct select_module
...
@@ -72,7 +72,7 @@ struct select_module
{
{
MIGRAPHX_THROW
(
"SELECT_MODULE: no compatible submodules found for given input shapes"
);
MIGRAPHX_THROW
(
"SELECT_MODULE: no compatible submodules found for given input shapes"
);
}
}
auto
module_to_run
=
*
module_iter
;
auto
*
module_to_run
=
*
module_iter
;
std
::
unordered_map
<
std
::
string
,
argument
>
params
;
std
::
unordered_map
<
std
::
string
,
argument
>
params
;
// add input parameters
// add input parameters
...
...
src/targets/gpu/lowering.cpp
View file @
5de36e4a
...
@@ -369,7 +369,7 @@ struct miopen_apply
...
@@ -369,7 +369,7 @@ struct miopen_apply
apply_map
.
emplace
(
"select_module"
,
[
=
](
instruction_ref
ins
)
{
apply_map
.
emplace
(
"select_module"
,
[
=
](
instruction_ref
ins
)
{
std
::
vector
<
instruction_ref
>
inputs
=
ins
->
inputs
();
std
::
vector
<
instruction_ref
>
inputs
=
ins
->
inputs
();
auto
mod_args
=
ins
->
module_inputs
();
auto
mod_args
=
ins
->
module_inputs
();
for
(
auto
smod
:
mod_args
)
for
(
auto
*
smod
:
mod_args
)
{
{
smod
->
use_local_alloc
=
true
;
smod
->
use_local_alloc
=
true
;
auto
last_ins
=
std
::
prev
(
smod
->
end
());
auto
last_ins
=
std
::
prev
(
smod
->
end
());
...
...
test/ref_ops_test.cpp
View file @
5de36e4a
...
@@ -7285,7 +7285,7 @@ TEST_CASE(select_module_add_test)
...
@@ -7285,7 +7285,7 @@ TEST_CASE(select_module_add_test)
auto literal_ins = mm->add_literal(migraphx::literal{lit_s, {6}});
auto literal_ins = mm->add_literal(migraphx::literal{lit_s, {6}});
// create batch submodules
// create batch submodules
auto create_submodule = [&](std::size_t batch_size, std::string module_name) {
auto create_submodule = [&](std::size_t batch_size,
const
std::string
&
module_name) {
auto* submod = p.create_module(module_name);
auto* submod = p.create_module(module_name);
migraphx::shape sm_shape{migraphx::shape::float_type, {batch_size, 4}};
migraphx::shape sm_shape{migraphx::shape::float_type, {batch_size, 4}};
auto sm_input = submod->add_parameter("data", sm_shape);
auto sm_input = submod->add_parameter("data", sm_shape);
...
@@ -7329,7 +7329,7 @@ TEST_CASE(select_module_reduce_test0)
...
@@ -7329,7 +7329,7 @@ TEST_CASE(select_module_reduce_test0)
migraphx::program p;
migraphx::program p;
// create batch submodules
// create batch submodules
auto create_submodule = [&](std::size_t batch_size, std::string module_name) {
auto create_submodule = [&](std::size_t batch_size,
const
std::string
&
module_name) {
auto* submod = p.create_module(module_name);
auto* submod = p.create_module(module_name);
migraphx::shape sm_shape{migraphx::shape::float_type, {batch_size, 2, 2}};
migraphx::shape sm_shape{migraphx::shape::float_type, {batch_size, 2, 2}};
auto sm_input = submod->add_parameter("data", sm_shape);
auto sm_input = submod->add_parameter("data", sm_shape);
...
@@ -7375,7 +7375,7 @@ TEST_CASE(select_module_reduce_test1)
...
@@ -7375,7 +7375,7 @@ TEST_CASE(select_module_reduce_test1)
migraphx::program p;
migraphx::program p;
// create batch submodules
// create batch submodules
auto create_submodule = [&](std::size_t batch_size, std::string module_name) {
auto create_submodule = [&](std::size_t batch_size,
const
std::string
&
module_name) {
auto* submod = p.create_module(module_name);
auto* submod = p.create_module(module_name);
migraphx::shape sm_shape{migraphx::shape::float_type, {batch_size, 2, 2}};
migraphx::shape sm_shape{migraphx::shape::float_type, {batch_size, 2, 2}};
auto sm_input = submod->add_parameter("data", sm_shape);
auto sm_input = submod->add_parameter("data", sm_shape);
...
...
test/verify/test_select_module_add.cpp
View file @
5de36e4a
...
@@ -37,7 +37,7 @@ struct test_select_module_add : verify_program<test_select_module_add>
...
@@ -37,7 +37,7 @@ struct test_select_module_add : verify_program<test_select_module_add>
auto
literal_ins
=
mm
->
add_literal
(
migraphx
::
literal
{
lit_s
,
{
6
}});
auto
literal_ins
=
mm
->
add_literal
(
migraphx
::
literal
{
lit_s
,
{
6
}});
// create batch submodules
// create batch submodules
auto
create_submodule
=
[
&
](
std
::
size_t
batch_size
,
std
::
string
module_name
)
{
auto
create_submodule
=
[
&
](
std
::
size_t
batch_size
,
const
std
::
string
&
module_name
)
{
auto
*
submod
=
p
.
create_module
(
module_name
);
auto
*
submod
=
p
.
create_module
(
module_name
);
migraphx
::
shape
sm_shape
{
migraphx
::
shape
::
float_type
,
{
batch_size
,
4
}};
migraphx
::
shape
sm_shape
{
migraphx
::
shape
::
float_type
,
{
batch_size
,
4
}};
auto
sm_input
=
submod
->
add_parameter
(
"data"
,
sm_shape
);
auto
sm_input
=
submod
->
add_parameter
(
"data"
,
sm_shape
);
...
...
test/verify/test_select_module_reduce.cpp
View file @
5de36e4a
...
@@ -34,8 +34,8 @@ struct test_select_module_reduce : verify_program<test_select_module_reduce>
...
@@ -34,8 +34,8 @@ struct test_select_module_reduce : verify_program<test_select_module_reduce>
migraphx
::
program
p
;
migraphx
::
program
p
;
// create batch submodules
// create batch submodules
auto
create_submodule
=
[
&
](
std
::
size_t
batch_size
,
std
::
string
module_name
)
{
auto
create_submodule
=
[
&
](
std
::
size_t
batch_size
,
const
std
::
string
&
module_name
)
{
auto
submod
=
p
.
create_module
(
module_name
);
auto
*
submod
=
p
.
create_module
(
module_name
);
migraphx
::
shape
sm_shape
{
migraphx
::
shape
::
float_type
,
{
batch_size
,
2
,
2
}};
migraphx
::
shape
sm_shape
{
migraphx
::
shape
::
float_type
,
{
batch_size
,
2
,
2
}};
auto
sm_input
=
submod
->
add_parameter
(
"data"
,
sm_shape
);
auto
sm_input
=
submod
->
add_parameter
(
"data"
,
sm_shape
);
auto
reduce_ins
=
auto
reduce_ins
=
...
...
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