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
dd26f1aa
Commit
dd26f1aa
authored
Apr 08, 2019
by
Shucai Xiao
Browse files
Merge branch 'develop' of
https://github.com/ROCmSoftwarePlatform/AMDMIGraphX
into rnn_optimization
parents
4e3d06ab
4a3e493c
Changes
125
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
211 additions
and
97 deletions
+211
-97
test/onnx/matmul_vv.onnx
test/onnx/matmul_vv.onnx
+16
-0
test/onnx/onnx_test.cpp
test/onnx/onnx_test.cpp
+109
-1
test/op_shape_test.cpp
test/op_shape_test.cpp
+84
-94
test/schedule_test.cpp
test/schedule_test.cpp
+1
-1
tools/include/concat_opt.hpp
tools/include/concat_opt.hpp
+1
-1
No files found.
test/onnx/matmul_vv.onnx
0 → 100644
View file @
dd26f1aa
matmul-example:S
1
2y"MatMultest_matmulZ
1
Z
2
b
y
B
\ No newline at end of file
test/onnx/onnx_test.cpp
View file @
dd26f1aa
...
@@ -566,7 +566,8 @@ TEST_CASE(gemm_test)
...
@@ -566,7 +566,8 @@ TEST_CASE(gemm_test)
auto
t0
=
p
.
add_instruction
(
migraphx
::
op
::
transpose
{{
1
,
0
}},
l0
);
auto
t0
=
p
.
add_instruction
(
migraphx
::
op
::
transpose
{{
1
,
0
}},
l0
);
auto
t1
=
p
.
add_instruction
(
migraphx
::
op
::
transpose
{{
1
,
0
}},
l1
);
auto
t1
=
p
.
add_instruction
(
migraphx
::
op
::
transpose
{{
1
,
0
}},
l1
);
auto
alpha
=
2.
f
;
auto
alpha
=
2.
f
;
p
.
add_instruction
(
migraphx
::
op
::
dot
{
alpha
},
t0
,
t1
);
auto
beta
=
2.0
f
;
p
.
add_instruction
(
migraphx
::
op
::
dot
{
alpha
,
beta
},
t0
,
t1
);
auto
prog
=
migraphx
::
parse_onnx
(
"gemm_test.onnx"
);
auto
prog
=
migraphx
::
parse_onnx
(
"gemm_test.onnx"
);
EXPECT
(
p
==
prog
);
EXPECT
(
p
==
prog
);
...
@@ -587,6 +588,113 @@ TEST_CASE(gemm_ex)
...
@@ -587,6 +588,113 @@ TEST_CASE(gemm_ex)
EXPECT
(
p
==
prog
);
EXPECT
(
p
==
prog
);
}
}
TEST_CASE
(
gemm_ex_brcst
)
{
migraphx
::
program
p
;
auto
l0
=
p
.
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
1
,
5
,
6
}});
auto
l1
=
p
.
add_parameter
(
"2"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
1
,
5
,
7
}});
auto
l2
=
p
.
add_parameter
(
"3"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
1
,
6
,
1
}});
auto
t0
=
p
.
add_instruction
(
migraphx
::
op
::
transpose
{{
0
,
1
,
3
,
2
}},
l0
);
std
::
vector
<
std
::
size_t
>
out_lens
{
1
,
1
,
6
,
7
};
auto
t2
=
p
.
add_instruction
(
migraphx
::
op
::
multibroadcast
{
out_lens
},
l2
);
auto
alpha
=
0.5
f
;
auto
beta
=
0.8
f
;
p
.
add_instruction
(
migraphx
::
op
::
dot
{
alpha
,
beta
},
t0
,
l1
,
t2
);
auto
prog
=
migraphx
::
parse_onnx
(
"gemm_test_ex1.onnx"
);
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
matmul_vv
)
{
migraphx
::
program
p
;
auto
l0
=
p
.
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
7
}});
auto
l1
=
p
.
add_parameter
(
"2"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
7
}});
auto
sl0
=
p
.
add_instruction
(
migraphx
::
op
::
unsqueeze
{{
0
}},
l0
);
auto
sl1
=
p
.
add_instruction
(
migraphx
::
op
::
unsqueeze
{{
1
}},
l1
);
auto
res
=
p
.
add_instruction
(
migraphx
::
op
::
dot
{
1.0
f
,
0.0
f
},
sl0
,
sl1
);
auto
sr0
=
p
.
add_instruction
(
migraphx
::
op
::
squeeze
{{
0
}},
res
);
p
.
add_instruction
(
migraphx
::
op
::
squeeze
{{
0
}},
sr0
);
auto
prog
=
migraphx
::
parse_onnx
(
"matmul_vv.onnx"
);
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
matmul_vm
)
{
migraphx
::
program
p
;
auto
l0
=
p
.
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
7
}});
auto
l1
=
p
.
add_parameter
(
"2"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
7
,
8
}});
auto
sl0
=
p
.
add_instruction
(
migraphx
::
op
::
unsqueeze
{{
0
}},
l0
);
auto
res
=
p
.
add_instruction
(
migraphx
::
op
::
dot
{
1.0
f
,
0.0
f
},
sl0
,
l1
);
p
.
add_instruction
(
migraphx
::
op
::
squeeze
{{
0
}},
res
);
auto
prog
=
migraphx
::
parse_onnx
(
"matmul_vm.onnx"
);
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
matmul_vbm
)
{
migraphx
::
program
p
;
auto
l0
=
p
.
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
7
}});
auto
l1
=
p
.
add_parameter
(
"2"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
5
,
7
,
8
}});
auto
sl0
=
p
.
add_instruction
(
migraphx
::
op
::
unsqueeze
{{
0
}},
l0
);
auto
bsl0
=
p
.
add_instruction
(
migraphx
::
op
::
multibroadcast
{{
5
,
1
,
7
}},
sl0
);
std
::
cout
<<
"ONNX_TEST"
<<
std
::
endl
;
auto
res
=
p
.
add_instruction
(
migraphx
::
op
::
dot
{
1.0
f
,
0.0
f
},
bsl0
,
l1
);
std
::
cout
<<
"After Dot"
<<
std
::
endl
;
p
.
add_instruction
(
migraphx
::
op
::
squeeze
{{
1
}},
res
);
auto
prog
=
migraphx
::
parse_onnx
(
"matmul_vbm.onnx"
);
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
matmul_mv
)
{
migraphx
::
program
p
;
auto
l0
=
p
.
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
6
,
7
}});
auto
l1
=
p
.
add_parameter
(
"2"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
7
}});
auto
sl1
=
p
.
add_instruction
(
migraphx
::
op
::
unsqueeze
{{
1
}},
l1
);
auto
res
=
p
.
add_instruction
(
migraphx
::
op
::
dot
{
1.0
f
,
0.0
f
},
l0
,
sl1
);
p
.
add_instruction
(
migraphx
::
op
::
squeeze
{{
1
}},
res
);
auto
prog
=
migraphx
::
parse_onnx
(
"matmul_mv.onnx"
);
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
matmul_bmv
)
{
migraphx
::
program
p
;
auto
l0
=
p
.
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
3
,
6
,
7
}});
auto
l1
=
p
.
add_parameter
(
"2"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
7
}});
auto
sl1
=
p
.
add_instruction
(
migraphx
::
op
::
unsqueeze
{{
1
}},
l1
);
auto
bsl1
=
p
.
add_instruction
(
migraphx
::
op
::
multibroadcast
{{
3
,
7
,
1
}},
sl1
);
auto
res
=
p
.
add_instruction
(
migraphx
::
op
::
dot
{
1.0
f
,
0.0
f
},
l0
,
bsl1
);
p
.
add_instruction
(
migraphx
::
op
::
squeeze
{{
2
}},
res
);
auto
prog
=
migraphx
::
parse_onnx
(
"matmul_bmv.onnx"
);
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
matmul_bmbm
)
{
migraphx
::
program
p
;
auto
l0
=
p
.
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
3
,
6
,
7
}});
auto
l1
=
p
.
add_parameter
(
"2"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
5
,
2
,
1
,
7
,
8
}});
auto
bl0
=
p
.
add_instruction
(
migraphx
::
op
::
multibroadcast
{{
5
,
2
,
3
,
6
,
7
}},
l0
);
auto
bl1
=
p
.
add_instruction
(
migraphx
::
op
::
multibroadcast
{{
5
,
2
,
3
,
7
,
8
}},
l1
);
p
.
add_instruction
(
migraphx
::
op
::
dot
{
1.0
f
,
0.0
f
},
bl0
,
bl1
);
auto
prog
=
migraphx
::
parse_onnx
(
"matmul_bmbm.onnx"
);
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
add_scalar_test
)
TEST_CASE
(
add_scalar_test
)
{
{
migraphx
::
program
p
;
migraphx
::
program
p
;
...
...
test/op_shape_test.cpp
View file @
dd26f1aa
...
@@ -377,65 +377,56 @@ TEST_CASE(matmul)
...
@@ -377,65 +377,56 @@ TEST_CASE(matmul)
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
5
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
5
}};
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
},
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
}
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
4
}};
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
}
}
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
5
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
5
,
4
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
5
,
2
}};
expect_shape
(
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
4
}},
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
}
}
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
5
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
1
,
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
4
,
4
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
5
}};
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
}
}
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
5
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
1
,
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
6
,
5
,
4
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
5
,
4
}};
expect_shape
(
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
6
,
4
}},
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
4
}},
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
}
}
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
5
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
1
,
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
5
,
4
,
4
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
4
,
4
}};
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
}
}
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
6
,
5
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
1
,
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
6
,
5
,
4
}};
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
6
}},
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
}
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
6
,
4
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
5
}};
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
}
}
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
3
,
6
,
5
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
6
,
1
,
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
6
,
5
,
4
}};
expect_shape
(
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
6
,
1
,
4
}},
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
3
,
6
}},
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
}
}
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
3
,
5
,
4
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
1
,
6
,
1
,
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
1
,
6
,
5
,
4
}};
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
6
,
1
,
4
}},
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
}
}
{
{
...
@@ -445,12 +436,6 @@ TEST_CASE(matmul)
...
@@ -445,12 +436,6 @@ TEST_CASE(matmul)
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
4
,
8
}},
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
4
,
8
}},
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
}
}
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
4
,
6
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
5
,
8
}};
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
}
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
1
,
1
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
1
,
1
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
1
,
1
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
1
,
1
}};
...
@@ -468,99 +453,104 @@ TEST_CASE(matmul)
...
@@ -468,99 +453,104 @@ TEST_CASE(matmul)
}
}
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
3
,
4
,
5
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
4
,
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
2
,
3
,
5
,
7
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
1
,
1
,
5
,
7
}};
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
2
,
3
,
4
,
7
}},
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
}
}
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
2
,
3
,
4
,
5
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
1
,
1
,
4
,
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
3
,
5
,
7
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
1
,
2
,
5
,
7
}};
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
2
,
3
,
4
,
7
}},
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
}
}
}
// 3 input arguments
TEST_CASE
(
gemm
)
{
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
2
,
3
,
4
,
5
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
4
,
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
5
,
7
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
5
,
8
}};
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
2
,
3
,
4
,
7
}},
migraphx
::
shape
s_m3
{
migraphx
::
shape
::
float_type
,
{
1
}};
migraphx
::
op
::
dot
{},
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
,
s_m3
);
s_m1
,
s_m2
);
}
}
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
4
,
5
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
4
,
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
1
,
1
,
5
,
7
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
5
,
8
}};
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
1
,
4
,
7
}},
migraphx
::
shape
s_m3
{
migraphx
::
shape
::
float_type
,
{
1
,
1
}};
migraphx
::
op
::
dot
{},
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
,
s_m3
);
s_m1
,
s_m2
);
}
}
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
1
,
1
,
4
,
5
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
4
,
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
1
,
2
,
5
,
7
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
5
,
8
}};
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
2
,
4
,
7
}},
migraphx
::
shape
s_m3
{
migraphx
::
shape
::
float_type
,
{
8
}};
migraphx
::
op
::
dot
{},
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
,
s_m3
);
s_m1
,
s_m2
);
}
}
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
1
,
2
,
4
,
5
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
4
,
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
2
,
1
,
5
,
7
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
5
,
8
}};
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
2
,
2
,
4
,
7
}},
migraphx
::
shape
s_m3
{
migraphx
::
shape
::
float_type
,
{
4
,
1
}};
migraphx
::
op
::
dot
{},
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
,
s_m3
);
s_m1
,
s_m2
);
}
}
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
2
,
4
,
5
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
4
,
6
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
2
,
1
,
5
,
7
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
5
,
8
}};
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
2
,
2
,
4
,
7
}},
migraphx
::
shape
s_m3
{
migraphx
::
shape
::
float_type
,
{
4
,
8
}};
migraphx
::
op
::
dot
{},
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
,
s_m3
);
s_m1
,
s_m2
);
}
}
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
4
,
5
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
4
,
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
2
,
1
,
5
,
7
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
5
,
8
}};
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
2
,
1
,
4
,
7
}},
migraphx
::
shape
s_m3
{
migraphx
::
shape
::
float_type
,
{
4
}};
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
,
s_m3
);
}
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
4
,
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
5
,
8
}};
migraphx
::
shape
s_m3
{
migraphx
::
shape
::
float_type
,
{
4
,
8
}};
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
4
,
8
}},
migraphx
::
op
::
dot
{},
migraphx
::
op
::
dot
{},
s_m1
,
s_m1
,
s_m2
);
s_m2
,
s_m3
);
}
}
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
3
,
1
,
4
,
6
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
1
,
4
,
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
3
,
1
,
5
,
7
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
1
,
5
,
8
}};
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
migraphx
::
shape
s_m3
{
migraphx
::
shape
::
float_type
,
{
1
,
4
,
8
}};
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
4
,
8
}},
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
,
s_m3
);
}
}
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
2
,
2
,
4
,
5
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
1
,
4
,
6
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
3
,
2
,
5
,
7
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
1
,
5
,
8
}};
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
migraphx
::
shape
s_m3
{
migraphx
::
shape
::
float_type
,
{
1
,
4
,
8
}};
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
,
s_m3
);
}
}
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
1
,
3
,
4
,
5
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
1
,
4
,
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
1
,
2
,
5
,
7
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
1
,
5
,
8
}};
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
migraphx
::
shape
s_m3
{
migraphx
::
shape
::
float_type
,
{
4
,
8
}};
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
,
s_m3
);
}
}
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
1
,
2
,
4
,
5
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
1
,
4
,
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
2
,
3
,
5
,
7
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
1
,
5
,
8
}};
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
migraphx
::
shape
s_m3
{
migraphx
::
shape
::
float_type
};
throws_shape
(
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
,
s_m3
);
}
}
}
}
...
...
test/schedule_test.cpp
View file @
dd26f1aa
#include <migraphx/schedule.hpp>
#include <migraphx/schedule.hpp>
#include <migraphx/op
erators
.hpp>
#include <migraphx/op
/identity
.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/instruction.hpp>
#include <migraphx/instruction.hpp>
#include <migraphx/iterator_for.hpp>
#include <migraphx/iterator_for.hpp>
...
...
tools/include/concat_opt.hpp
View file @
dd26f1aa
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
#include <utility>
#include <utility>
#include <migraphx/operation.hpp>
#include <migraphx/operation.hpp>
#include <migraphx/op
erators
.hpp>
#include <migraphx/op
/concat
.hpp>
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
...
...
Prev
1
…
3
4
5
6
7
Next
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