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
c8bcc541
Commit
c8bcc541
authored
Feb 09, 2022
by
Shucai Xiao
Browse files
add calculation of flops for the convolution
parent
a175f14c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
src/program.cpp
src/program.cpp
+17
-0
No files found.
src/program.cpp
View file @
c8bcc541
...
@@ -629,6 +629,23 @@ auto get_flops_funcs()
...
@@ -629,6 +629,23 @@ auto get_flops_funcs()
return
2.0
*
m
*
n
*
k
*
batch
;
return
2.0
*
m
*
n
*
k
*
batch
;
});
});
op_funcs
.
emplace
(
"convolution"
,
[
&
](
const
std
::
vector
<
shape
>&
vec_ss
)
{
assert
(
vec_ss
.
size
()
>=
2
);
auto
alens
=
vec_ss
.
front
().
lens
();
auto
blens
=
vec_ss
.
at
(
1
).
lens
();
auto
olens
=
vec_ss
.
back
().
lens
();
auto
n
=
alens
.
front
();
auto
k
=
blens
.
front
();
auto
c
=
alens
.
at
(
1
);
auto
y
=
blens
.
at
(
2
);
auto
x
=
blens
.
back
();
auto
ho
=
olens
.
at
(
2
);
auto
wo
=
olens
.
back
();
return
2.0
*
n
*
k
*
ho
*
wo
*
c
*
y
*
x
;
});
return
op_funcs
;
return
op_funcs
;
}
}
...
...
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