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
32751f4a
Commit
32751f4a
authored
Apr 05, 2019
by
Shucai Xiao
Browse files
clang format
parent
d5122475
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
90 additions
and
91 deletions
+90
-91
src/include/migraphx/operators.hpp
src/include/migraphx/operators.hpp
+1
-1
src/targets/gpu/gemm.cpp
src/targets/gpu/gemm.cpp
+20
-23
test/cpu_dot_op_test.cpp
test/cpu_dot_op_test.cpp
+20
-20
test/gpu/miopen.cpp
test/gpu/miopen.cpp
+26
-28
test/onnx/onnx_test.cpp
test/onnx/onnx_test.cpp
+15
-15
test/op_shape_test.cpp
test/op_shape_test.cpp
+8
-4
No files found.
src/include/migraphx/operators.hpp
View file @
32751f4a
...
@@ -845,7 +845,7 @@ struct dot
...
@@ -845,7 +845,7 @@ struct dot
const
shape
&
b
=
inputs
.
at
(
1
);
const
shape
&
b
=
inputs
.
at
(
1
);
auto
t
=
a
.
type
();
auto
t
=
a
.
type
();
if
(
!
std
::
all_of
(
inputs
.
begin
(),
inputs
.
end
(),
[](
auto
s
)
{
return
s
.
lens
().
size
()
>=
2
;
}))
if
(
!
std
::
all_of
(
inputs
.
begin
(),
inputs
.
end
(),
[](
auto
s
)
{
return
s
.
lens
().
size
()
>=
2
;
}))
{
{
MIGRAPHX_THROW
(
"DOT: dot only accept 2 or more dims operands"
);
MIGRAPHX_THROW
(
"DOT: dot only accept 2 or more dims operands"
);
}
}
...
...
src/targets/gpu/gemm.cpp
View file @
32751f4a
...
@@ -255,15 +255,12 @@ argument miopen_gemm::compute(context& ctx,
...
@@ -255,15 +255,12 @@ argument miopen_gemm::compute(context& ctx,
rocblas_int
m
=
out_lens
[
dim_0
];
rocblas_int
m
=
out_lens
[
dim_0
];
rocblas_int
n
=
out_lens
[
dim_1
];
rocblas_int
n
=
out_lens
[
dim_1
];
rocblas_int
k
=
args
[
0
].
get_shape
().
lens
()[
dim_1
];
rocblas_int
k
=
args
[
0
].
get_shape
().
lens
()[
dim_1
];
auto
num_matrices
=
std
::
accumulate
(
out_lens
.
rbegin
()
+
2
,
auto
num_matrices
=
std
::
accumulate
(
out_lens
.
rend
(),
out_lens
.
rbegin
()
+
2
,
out_lens
.
rend
(),
std
::
size_t
{
1
},
std
::
multiplies
<
std
::
size_t
>
());
std
::
size_t
{
1
},
std
::
multiplies
<
std
::
size_t
>
());
auto
to_pointer
=
[
&
](
auto
&&
arg
)
{
return
to_rocblas_type
(
as
.
from
(
arg
.
data
()));
};
auto
to_pointer
=
[
&
](
auto
&&
arg
)
{
return
to_rocblas_type
(
as
.
from
(
arg
.
data
()));
};
if
(
num_matrices
==
1
)
if
(
num_matrices
==
1
)
{
{
generic_rocblas_gemm
(
generic_rocblas_gemm
(
as
,
as
,
ctx
.
get_stream
().
get_rocblas
(),
ctx
.
get_stream
().
get_rocblas
(),
transb
?
rocblas_operation_transpose
:
rocblas_operation_none
,
transb
?
rocblas_operation_transpose
:
rocblas_operation_none
,
transa
?
rocblas_operation_transpose
:
rocblas_operation_none
,
transa
?
rocblas_operation_transpose
:
rocblas_operation_none
,
...
...
test/cpu_dot_op_test.cpp
View file @
32751f4a
test/gpu/miopen.cpp
View file @
32751f4a
...
@@ -1054,7 +1054,6 @@ struct gemm_2args_mv : verify_program<gemm_2args_mv>
...
@@ -1054,7 +1054,6 @@ struct gemm_2args_mv : verify_program<gemm_2args_mv>
auto
l2
=
p
.
add_parameter
(
"2"
,
m2_shape
);
auto
l2
=
p
.
add_parameter
(
"2"
,
m2_shape
);
auto
ul2
=
p
.
add_instruction
(
migraphx
::
op
::
unsqueeze
{{
1
}},
l2
);
auto
ul2
=
p
.
add_instruction
(
migraphx
::
op
::
unsqueeze
{{
1
}},
l2
);
p
.
add_instruction
(
migraphx
::
op
::
dot
{},
l1
,
ul2
);
p
.
add_instruction
(
migraphx
::
op
::
dot
{},
l1
,
ul2
);
return
p
;
return
p
;
...
@@ -1113,7 +1112,6 @@ struct gemm_2args_vbm : verify_program<gemm_2args_vbm>
...
@@ -1113,7 +1112,6 @@ struct gemm_2args_vbm : verify_program<gemm_2args_vbm>
auto
res
=
p
.
add_instruction
(
migraphx
::
op
::
dot
{},
bul1
,
l2
);
auto
res
=
p
.
add_instruction
(
migraphx
::
op
::
dot
{},
bul1
,
l2
);
p
.
add_instruction
(
migraphx
::
op
::
squeeze
{{
2
}},
res
);
p
.
add_instruction
(
migraphx
::
op
::
squeeze
{{
2
}},
res
);
return
p
;
return
p
;
}
}
};
};
...
...
test/onnx/onnx_test.cpp
View file @
32751f4a
test/op_shape_test.cpp
View file @
32751f4a
...
@@ -414,15 +414,19 @@ TEST_CASE(matmul)
...
@@ -414,15 +414,19 @@ TEST_CASE(matmul)
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
6
,
1
,
5
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
6
,
1
,
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
6
,
5
,
4
}};
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
,
{
6
,
1
,
4
}},
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
}
}
{
{
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
1
,
6
,
1
,
5
}};
migraphx
::
shape
s_m1
{
migraphx
::
shape
::
float_type
,
{
1
,
6
,
1
,
5
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
1
,
6
,
5
,
4
}};
migraphx
::
shape
s_m2
{
migraphx
::
shape
::
float_type
,
{
1
,
6
,
5
,
4
}};
expect_shape
(
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
6
,
1
,
4
}},
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
6
,
1
,
4
}},
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
migraphx
::
op
::
dot
{},
s_m1
,
s_m2
);
}
}
{
{
...
...
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