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
49e7cd87
Commit
49e7cd87
authored
Jun 25, 2018
by
Paul
Browse files
Formatting
parent
7c885dbb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
src/targets/miopen/miopen_target.cpp
src/targets/miopen/miopen_target.cpp
+5
-4
test/miopen/miopen.cpp
test/miopen/miopen.cpp
+1
-1
No files found.
src/targets/miopen/miopen_target.cpp
View file @
49e7cd87
...
...
@@ -156,9 +156,10 @@ struct miopen_gemm
visit_all
(
result
,
from_gpu
(
args
[
1
]),
from_gpu
(
args
[
2
]))(
[
&
](
auto
output
,
auto
input1
,
auto
input2
)
{
dfor
(
input1
.
get_shape
().
lens
()[
0
],
input2
.
get_shape
().
lens
()[
1
],
input2
.
get_shape
().
lens
()[
0
])([
&
](
auto
i
,
auto
j
,
auto
k
)
{
output
(
i
,
j
)
+=
input1
(
i
,
k
)
*
input2
(
k
,
j
);
});
dfor
(
input1
.
get_shape
().
lens
()[
0
],
input2
.
get_shape
().
lens
()[
1
],
input2
.
get_shape
().
lens
()[
0
])(
[
&
](
auto
i
,
auto
j
,
auto
k
)
{
output
(
i
,
j
)
+=
input1
(
i
,
k
)
*
input2
(
k
,
j
);
});
});
return
to_gpu
(
result
);
}
...
...
@@ -284,7 +285,7 @@ struct miopen_apply
void
apply_gemm
(
instruction_ref
ins
)
{
auto
&&
op
=
any_cast
<
gemm
>
(
ins
->
op
);
auto
&&
op
=
any_cast
<
gemm
>
(
ins
->
op
);
auto
output
=
insert_allocation
(
ins
,
ins
->
result
);
prog
->
replace_instruction
(
ins
,
miopen_gemm
{
op
},
handle
,
ins
->
arguments
.
at
(
0
),
ins
->
arguments
.
at
(
1
),
output
);
...
...
test/miopen/miopen.cpp
View file @
49e7cd87
...
...
@@ -141,7 +141,7 @@ struct test_gemm
rtg
::
program
create_program
()
const
{
rtg
::
program
p
;
auto
a
=
p
.
add_parameter
(
"a"
,
rtg
::
shape
{
rtg
::
shape
::
float_type
,
{
4
,
5
}});
auto
a
=
p
.
add_parameter
(
"a"
,
rtg
::
shape
{
rtg
::
shape
::
float_type
,
{
4
,
5
}});
auto
b
=
p
.
add_parameter
(
"b"
,
rtg
::
shape
{
rtg
::
shape
::
float_type
,
{
5
,
3
}});
p
.
add_instruction
(
rtg
::
gemm
{},
a
,
b
);
return
p
;
...
...
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