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
d99f4860
Commit
d99f4860
authored
Oct 19, 2021
by
Paul
Browse files
Add test case
parent
4ec19433
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
src/mlir.cpp
src/mlir.cpp
+2
-0
test/mlir.cpp
test/mlir.cpp
+19
-0
No files found.
src/mlir.cpp
View file @
d99f4860
...
...
@@ -398,6 +398,8 @@ struct mlir_program
auto
fbody
=
insert
(
mbody
,
m
,
ins_map
);
for
(
auto
ins
:
iterator_for
(
m
))
{
if
(
ins
->
name
()
==
"@param"
)
continue
;
auto
name
=
"migraphx."
+
ins
->
name
();
auto
ops
=
create_operation_state
(
name
);
ops
.
add_attribute_value
(
ins
->
get_operator
().
to_value
());
...
...
test/mlir.cpp
0 → 100644
View file @
d99f4860
#include <migraphx/mlir.hpp>
#include <migraphx/module.hpp>
#include <migraphx/make_op.hpp>
#include <migraphx/ranges.hpp>
#include <test.hpp>
TEST_CASE
(
conv
)
{
migraphx
::
module
m
;
auto
x
=
m
.
add_parameter
(
"x"
,
{
migraphx
::
shape
::
float_type
,
{
1
,
8
,
4
,
4
}});
auto
w
=
m
.
add_parameter
(
"w"
,
{
migraphx
::
shape
::
float_type
,
{
2
,
8
,
3
,
3
}});
m
.
add_instruction
(
migraphx
::
make_op
(
"convolution"
),
x
,
w
);
auto
s
=
migraphx
::
dump_mlir
(
m
);
std
::
cout
<<
s
<<
std
::
endl
;
EXPECT
(
migraphx
::
contains
(
s
,
"migraphx.convolution"
));
EXPECT
(
not
migraphx
::
contains
(
s
,
"migraphx.@param"
));
}
int
main
(
int
argc
,
const
char
*
argv
[])
{
test
::
run
(
argc
,
argv
);
}
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