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
abb27ba0
"ts/nni_manager/vscode:/vscode.git/clone" did not exist on "98875f52e7c33d024b372bfd7cc30b1c0fbe0605"
Commit
abb27ba0
authored
Aug 20, 2018
by
Paul
Browse files
Formatting
parent
3e141c95
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
12 deletions
+13
-12
src/program.cpp
src/program.cpp
+11
-6
src/targets/cpu/include/migraph/cpu/context.hpp
src/targets/cpu/include/migraph/cpu/context.hpp
+1
-2
src/targets/gpu/include/migraph/gpu/context.hpp
src/targets/gpu/include/migraph/gpu/context.hpp
+1
-4
No files found.
src/program.cpp
View file @
abb27ba0
...
...
@@ -340,7 +340,10 @@ void program::perf_report(std::ostream& os, std::size_t n, parameter_map params)
total_vec
.
reserve
(
n
);
for
(
std
::
size_t
i
=
0
;
i
<
n
;
i
++
)
{
total_vec
.
push_back
(
time
<
milliseconds
>
([
&
]
{
eval
(
params
);
ctx
.
finish
();
}));
total_vec
.
push_back
(
time
<
milliseconds
>
([
&
]
{
eval
(
params
);
ctx
.
finish
();
}));
}
std
::
sort
(
total_vec
.
begin
(),
total_vec
.
end
());
std
::
unordered_map
<
instruction_ref
,
std
::
vector
<
double
>>
ins_vec
;
...
...
@@ -354,7 +357,10 @@ void program::perf_report(std::ostream& os, std::size_t n, parameter_map params)
{
generic_eval
(
*
this
,
ctx
,
params
,
[
&
](
auto
ins
,
auto
f
)
{
argument
result
;
ins_vec
[
ins
].
push_back
(
time
<
milliseconds
>
([
&
]
{
result
=
f
();
ctx
.
finish
();
}));
ins_vec
[
ins
].
push_back
(
time
<
milliseconds
>
([
&
]
{
result
=
f
();
ctx
.
finish
();
}));
return
result
;
});
}
...
...
@@ -365,9 +371,8 @@ void program::perf_report(std::ostream& os, std::size_t n, parameter_map params)
overhead_vec
.
reserve
(
n
);
for
(
std
::
size_t
i
=
0
;
i
<
n
;
i
++
)
{
overhead_vec
.
push_back
(
time
<
milliseconds
>
([
&
]
{
generic_eval
(
*
this
,
ctx
,
params
,
[](
auto
...)
{
return
argument
{};
});
}));
overhead_vec
.
push_back
(
time
<
milliseconds
>
(
[
&
]
{
generic_eval
(
*
this
,
ctx
,
params
,
[](
auto
...)
{
return
argument
{};
});
}));
}
double
total_time
=
common_average
(
total_vec
);
...
...
src/targets/cpu/include/migraph/cpu/context.hpp
View file @
abb27ba0
...
...
@@ -6,8 +6,7 @@ namespace cpu {
struct
context
{
void
finish
()
const
{}
void
finish
()
const
{}
};
}
// namespace cpu
...
...
src/targets/gpu/include/migraph/gpu/context.hpp
View file @
abb27ba0
...
...
@@ -12,10 +12,7 @@ struct context
{
shared
<
miopen_handle
>
handle
;
shared
<
rocblas_handle_ptr
>
rbhandle
;
void
finish
()
const
{
gpu_sync
();
}
void
finish
()
const
{
gpu_sync
();
}
};
}
// namespace gpu
...
...
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