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
0f2b0684
Commit
0f2b0684
authored
Aug 03, 2018
by
Paul
Browse files
Formatting
parent
cff83eda
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
src/include/migraph/operators.hpp
src/include/migraph/operators.hpp
+1
-1
src/targets/cpu/cpu_lowering.cpp
src/targets/cpu/cpu_lowering.cpp
+5
-5
No files found.
src/include/migraph/operators.hpp
View file @
0f2b0684
...
@@ -314,7 +314,7 @@ struct reshape
...
@@ -314,7 +314,7 @@ struct reshape
struct
gemm
struct
gemm
{
{
float
alpha
=
1.0
;
float
alpha
=
1.0
;
float
beta
=
0.0
;
float
beta
=
0.0
;
std
::
string
name
()
const
{
return
"gemm"
;
}
std
::
string
name
()
const
{
return
"gemm"
;
}
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
{
...
...
src/targets/cpu/cpu_lowering.cpp
View file @
0f2b0684
...
@@ -227,10 +227,10 @@ struct cpu_gemm
...
@@ -227,10 +227,10 @@ struct cpu_gemm
std
::
string
name
()
const
{
return
"cpu::gemm"
;
}
std
::
string
name
()
const
{
return
"cpu::gemm"
;
}
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
return
op
.
compute_shape
(
inputs
);
}
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
return
op
.
compute_shape
(
inputs
);
}
template
<
class
T
>
template
<
class
T
>
using
matrix
=
blaze
::
CustomMatrix
<
T
,
blaze
::
unaligned
,
blaze
::
unpadded
>
;
// NOLINT
using
matrix
=
blaze
::
CustomMatrix
<
T
,
blaze
::
unaligned
,
blaze
::
unpadded
>
;
// NOLINT
template
<
class
T
>
template
<
class
T
>
static
auto
make_mat
(
tensor_view
<
T
>
x
)
static
auto
make_mat
(
tensor_view
<
T
>
x
)
{
{
const
auto
&
s
=
x
.
get_shape
();
const
auto
&
s
=
x
.
get_shape
();
...
@@ -241,7 +241,7 @@ struct cpu_gemm
...
@@ -241,7 +241,7 @@ struct cpu_gemm
return
matrix
<
T
>
{
x
.
data
(),
s
.
lens
()[
0
],
s
.
lens
()[
1
]};
return
matrix
<
T
>
{
x
.
data
(),
s
.
lens
()[
0
],
s
.
lens
()[
1
]};
}
}
template
<
class
T
,
class
F
>
template
<
class
T
,
class
F
>
static
void
visit_mat
(
tensor_view
<
T
>
x
,
F
f
)
static
void
visit_mat
(
tensor_view
<
T
>
x
,
F
f
)
{
{
auto
mat
=
make_mat
(
x
);
auto
mat
=
make_mat
(
x
);
...
@@ -258,9 +258,9 @@ struct cpu_gemm
...
@@ -258,9 +258,9 @@ struct cpu_gemm
visit_mat
(
amat
,
[
&
](
const
auto
&
a
)
{
visit_mat
(
amat
,
[
&
](
const
auto
&
a
)
{
visit_mat
(
bmat
,
[
&
](
const
auto
&
b
)
{
visit_mat
(
bmat
,
[
&
](
const
auto
&
b
)
{
auto
c
=
make_mat
(
cmat
);
auto
c
=
make_mat
(
cmat
);
if
(
op
.
alpha
==
1.0
and
op
.
beta
==
0.0
)
if
(
op
.
alpha
==
1.0
and
op
.
beta
==
0.0
)
c
=
a
*
b
;
c
=
a
*
b
;
else
else
c
=
(
a
*
b
)
*
op
.
alpha
+
op
.
beta
*
c
;
c
=
(
a
*
b
)
*
op
.
alpha
+
op
.
beta
*
c
;
});
});
});
});
...
...
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