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
2426e157
Commit
2426e157
authored
Mar 14, 2019
by
Shucai Xiao
Browse files
fixed cppcheck errors
parent
6f5895cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
src/targets/cpu/lowering.cpp
src/targets/cpu/lowering.cpp
+3
-7
No files found.
src/targets/cpu/lowering.cpp
View file @
2426e157
...
@@ -379,7 +379,7 @@ struct cpu_gemm
...
@@ -379,7 +379,7 @@ struct cpu_gemm
if
(
out_lens
==
c_lens
)
if
(
out_lens
==
c_lens
)
{
{
visit_all
(
result
,
c
)([
&
](
auto
output
,
auto
input
)
{
visit_all
(
result
,
c
)([
&
](
auto
output
,
auto
input
)
{
std
::
memcpy
(
output
.
data
(),
input
.
data
(),
c
.
get_shape
().
bytes
());
std
::
copy
(
input
.
begin
(),
input
.
end
(),
output
.
begin
());
});
});
}
}
// need broadcast
// need broadcast
...
@@ -397,7 +397,7 @@ struct cpu_gemm
...
@@ -397,7 +397,7 @@ struct cpu_gemm
visit_all
(
result
,
c
)([
&
](
auto
output
,
auto
input
)
{
visit_all
(
result
,
c
)([
&
](
auto
output
,
auto
input
)
{
for
(
std
::
size_t
i
=
0
;
i
<
m
;
i
++
)
for
(
std
::
size_t
i
=
0
;
i
<
m
;
i
++
)
{
{
std
::
memcpy
((
output
.
data
()
+
i
*
n
),
input
.
data
(),
c
.
get_shape
().
bytes
()
);
std
::
copy
(
input
.
begin
(),
input
.
end
(),
output
.
begin
()
+
i
*
n
);
}
}
});
});
}
}
...
@@ -428,7 +428,7 @@ struct cpu_gemm
...
@@ -428,7 +428,7 @@ struct cpu_gemm
if
(
op
.
beta
==
0.0
f
)
if
(
op
.
beta
==
0.0
f
)
{
{
result
.
visit
(
result
.
visit
(
[
&
](
auto
output
)
{
std
::
memset
(
output
.
data
(),
0
,
output
_shape
.
bytes
()
);
});
[
&
](
auto
output
)
{
std
::
fill
(
output
.
begin
(),
output
.
end
(),
0
);
});
}
}
else
else
{
{
...
@@ -445,11 +445,9 @@ struct cpu_gemm
...
@@ -445,11 +445,9 @@ struct cpu_gemm
auto
a_lens
=
args
[
0
].
get_shape
().
lens
();
auto
a_lens
=
args
[
0
].
get_shape
().
lens
();
auto
b_lens
=
args
[
1
].
get_shape
().
lens
();
auto
b_lens
=
args
[
1
].
get_shape
().
lens
();
auto
out_lens
=
output_shape
.
lens
();
auto
out_lens
=
output_shape
.
lens
();
bool
is_a_prepended
=
false
;
shape
::
type_t
t
=
output_shape
.
type
();
shape
::
type_t
t
=
output_shape
.
type
();
if
(
a_lens
.
size
()
==
1
)
if
(
a_lens
.
size
()
==
1
)
{
{
is_a_prepended
=
true
;
a_lens
.
insert
(
a_lens
.
begin
(),
1
);
a_lens
.
insert
(
a_lens
.
begin
(),
1
);
out_lens
.
push_back
(
1
);
out_lens
.
push_back
(
1
);
if
(
out_lens
.
size
()
>
1
)
if
(
out_lens
.
size
()
>
1
)
...
@@ -458,10 +456,8 @@ struct cpu_gemm
...
@@ -458,10 +456,8 @@ struct cpu_gemm
}
}
}
}
bool
is_b_appended
=
false
;
if
(
b_lens
.
size
()
==
1
)
if
(
b_lens
.
size
()
==
1
)
{
{
is_b_appended
=
true
;
b_lens
.
push_back
(
1
);
b_lens
.
push_back
(
1
);
out_lens
.
push_back
(
1
);
out_lens
.
push_back
(
1
);
}
}
...
...
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