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
60917cc7
Commit
60917cc7
authored
Mar 04, 2019
by
Paul
Browse files
Sort based on weights
parent
aea65ed4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
src/schedule.cpp
src/schedule.cpp
+6
-2
src/targets/gpu/include/migraphx/gpu/context.hpp
src/targets/gpu/include/migraphx/gpu/context.hpp
+1
-1
src/targets/gpu/schedule_model.cpp
src/targets/gpu/schedule_model.cpp
+2
-1
No files found.
src/schedule.cpp
View file @
60917cc7
...
@@ -218,9 +218,13 @@ void schedule::apply(program& p) const
...
@@ -218,9 +218,13 @@ void schedule::apply(program& p) const
// Topo sort
// Topo sort
fix
([
&
](
auto
self
,
auto
ins
)
{
fix
([
&
](
auto
self
,
auto
ins
)
{
for
(
auto
i
:
ins
->
inputs
())
auto
args
=
ins
->
inputs
();
std
::
sort
(
args
.
begin
(),
args
.
end
(),
[
&
](
auto
x
,
auto
y
)
{
return
si
.
weights
[
x
]
<
si
.
weights
[
y
];
});
for
(
auto
i
:
args
)
p
.
move_instruction
(
i
,
p
.
begin
());
p
.
move_instruction
(
i
,
p
.
begin
());
for
(
auto
i
:
ins
->
inputs
()
)
for
(
auto
i
:
args
)
self
(
i
);
self
(
i
);
})(
last
);
})(
last
);
...
...
src/targets/gpu/include/migraphx/gpu/context.hpp
View file @
60917cc7
...
@@ -36,7 +36,7 @@ struct hip_device
...
@@ -36,7 +36,7 @@ struct hip_device
static
hip_stream_ptr
create_stream
()
static
hip_stream_ptr
create_stream
()
{
{
hipStream_t
result
=
nullptr
;
hipStream_t
result
=
nullptr
;
auto
status
=
hipStreamCreate
(
&
result
);
auto
status
=
hipStreamCreate
WithFlags
(
&
result
,
hipStreamNonBlocking
);
if
(
status
!=
hipSuccess
)
if
(
status
!=
hipSuccess
)
MIGRAPHX_THROW
(
"Failed to allocate stream"
);
MIGRAPHX_THROW
(
"Failed to allocate stream"
);
return
hip_stream_ptr
{
result
};
return
hip_stream_ptr
{
result
};
...
...
src/targets/gpu/schedule_model.cpp
View file @
60917cc7
...
@@ -13,7 +13,8 @@ using hip_event_ptr = MIGRAPHX_MANAGE_PTR(hipEvent_t, hipEventDestroy);
...
@@ -13,7 +13,8 @@ using hip_event_ptr = MIGRAPHX_MANAGE_PTR(hipEvent_t, hipEventDestroy);
hip_event_ptr
create_event
()
hip_event_ptr
create_event
()
{
{
hipEvent_t
event
;
hipEvent_t
event
;
auto
status
=
hipEventCreateWithFlags
(
&
event
,
hipEventDisableTiming
);
// Default is hipEventReleaseToDevice
auto
status
=
hipEventCreateWithFlags
(
&
event
,
hipEventDisableTiming
|
hipEventReleaseToSystem
|
hipEventBlockingSync
);
if
(
status
!=
hipSuccess
)
if
(
status
!=
hipSuccess
)
MIGRAPHX_THROW
(
"Failed to create event"
);
MIGRAPHX_THROW
(
"Failed to create event"
);
return
hip_event_ptr
{
event
};
return
hip_event_ptr
{
event
};
...
...
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