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
88cbdc7a
Commit
88cbdc7a
authored
Aug 09, 2018
by
Paul
Browse files
Add more tests
parent
e11ce251
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
test/auto_contiguous_test.cpp
test/auto_contiguous_test.cpp
+31
-0
No files found.
test/auto_contiguous_test.cpp
View file @
88cbdc7a
...
...
@@ -18,8 +18,37 @@ migraph::literal get_2x2()
return
migraph
::
literal
{{
migraph
::
shape
::
float_type
,
{
2
,
2
}},
{
1
,
2
,
3
,
4
}};
}
migraph
::
literal
get_2x2_transposed
()
{
return
migraph
::
literal
{{
migraph
::
shape
::
float_type
,
{
2
,
2
},
{
1
,
2
}},
{
1
,
2
,
3
,
4
}};
}
migraph
::
literal
get_2
()
{
return
migraph
::
literal
{{
migraph
::
shape
::
float_type
,
{
2
}},
{
1
,
2
}};
}
migraph
::
literal
get_2_broadcasted
()
{
return
migraph
::
literal
{{
migraph
::
shape
::
float_type
,
{
2
},
{
1
,
0
}},
{
1
,
2
}};
}
void
literal_broadcast
()
{
migraph
::
program
p
;
p
.
add_literal
(
get_2_broadcasted
());
EXPECT
(
not
p
.
get_shape
().
standard
());
EXPECT
(
p
.
get_shape
().
broadcasted
());
p
.
compile
(
contiguous_target
{});
EXPECT
(
p
.
get_shape
().
standard
());
EXPECT
(
not
p
.
get_shape
().
broadcasted
());
}
void
literal_transpose
()
{
migraph
::
program
p
;
p
.
add_literal
(
get_2x2_transposed
());
EXPECT
(
not
p
.
get_shape
().
standard
());
EXPECT
(
p
.
get_shape
().
transposed
());
p
.
compile
(
contiguous_target
{});
EXPECT
(
p
.
get_shape
().
standard
());
EXPECT
(
not
p
.
get_shape
().
transposed
());
}
void
after_literal_transpose
()
{
migraph
::
program
p
;
...
...
@@ -84,6 +113,8 @@ void after_param_broadcast()
int
main
()
{
literal_broadcast
();
literal_transpose
();
after_literal_transpose
();
after_literal_broadcast
();
after_param_transpose
();
...
...
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