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
674b3bac
"examples/vscode:/vscode.git/clone" did not exist on "b8c0fb6e6a3db59704e07677b0f68aff5388bc69"
Commit
674b3bac
authored
May 26, 2023
by
Paul
Browse files
Add banchmarking
parent
52223d46
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
src/targets/gpu/compile_ops.cpp
src/targets/gpu/compile_ops.cpp
+14
-6
No files found.
src/targets/gpu/compile_ops.cpp
View file @
674b3bac
...
...
@@ -30,6 +30,7 @@
#include <migraphx/register_op.hpp>
#include <migraphx/op/identity.hpp>
#include <migraphx/gpu/compiler.hpp>
#include <migraphx/gpu/time_op.hpp>
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
...
...
@@ -107,16 +108,23 @@ struct compile_plan
});
}
}
void
replace
(
mod
ul
e
&
m
)
const
const
compiled_res
ul
t
&
benchmark
(
)
const
{
if
(
results
.
size
()
==
1
)
return
results
.
front
();
std
::
cout
<<
"Benchmarking "
<<
preop
.
name
()
<<
": "
<<
results
.
size
()
<<
" configs"
<<
std
::
endl
;
std
::
vector
<
double
>
times
;
for
(
const
auto
&
cr
:
results
)
{
results
.
front
().
replace
.
replace
(
m
,
results
.
front
().
ins
);
}
else
{
// TODO: Benchmark
times
.
push_back
(
time_op
(
*
ctx
,
cr
.
replace
.
code_object
,
to_shapes
(
cr
.
ins
->
inputs
()),
20
).
first
);
}
auto
i
=
std
::
distance
(
times
.
begin
(),
std
::
min_element
(
times
.
begin
(),
times
.
end
()));
return
results
[
i
];
}
void
replace
(
module
&
m
)
const
{
const
auto
&
cr
=
benchmark
();
cr
.
replace
.
replace
(
m
,
cr
.
ins
);
}
};
...
...
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