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
58a845fa
Commit
58a845fa
authored
Apr 30, 2019
by
Shucai Xiao
Browse files
add one tests for copy program.
parent
9294fe64
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
test/program_test.cpp
test/program_test.cpp
+20
-0
No files found.
test/program_test.cpp
View file @
58a845fa
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
#include <migraphx/iterator_for.hpp>
#include <migraphx/iterator_for.hpp>
#include <migraphx/instruction.hpp>
#include <migraphx/instruction.hpp>
#include <migraphx/op/add.hpp>
#include <migraphx/op/add.hpp>
#include <migraphx/op/dot.hpp>
#include <migraphx/op/mul.hpp>
#include <migraphx/op/mul.hpp>
#include <migraphx/cpu/target.hpp>
#include <migraphx/cpu/target.hpp>
#include <sstream>
#include <sstream>
...
@@ -83,6 +84,25 @@ TEST_CASE(program_copy)
...
@@ -83,6 +84,25 @@ TEST_CASE(program_copy)
EXPECT
(
p1
==
p2
);
EXPECT
(
p1
==
p2
);
}
}
{
migraphx
::
program
p1
;
migraphx
::
shape
s1
{
migraphx
::
shape
::
float_type
,
{
2
,
3
}};
migraphx
::
shape
s2
{
migraphx
::
shape
::
float_type
,
{
3
,
6
}};
migraphx
::
shape
s3
{
migraphx
::
shape
::
float_type
,
{
2
,
6
}};
auto
para1
=
p1
.
add_parameter
(
"m1"
,
s1
);
auto
para2
=
p1
.
add_parameter
(
"m2"
,
s2
);
auto
para3
=
p1
.
add_parameter
(
"m3"
,
s3
);
p1
.
add_instruction
(
migraphx
::
op
::
dot
{
0.31
f
,
0.28
f
},
para1
,
para2
,
para3
);
migraphx
::
program
p2
{};
p2
=
p1
;
EXPECT
(
p2
==
p1
);
p1
.
compile
(
migraphx
::
cpu
::
target
{});
p2
.
compile
(
migraphx
::
cpu
::
target
{});
EXPECT
(
p2
==
p1
);
}
}
}
int
main
(
int
argc
,
const
char
*
argv
[])
{
test
::
run
(
argc
,
argv
);
}
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