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
2f7db364
Commit
2f7db364
authored
Mar 06, 2019
by
Paul
Browse files
Formatting
parent
e0b0cd9e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
16 deletions
+13
-16
src/schedule.cpp
src/schedule.cpp
+9
-6
src/targets/gpu/include/migraphx/gpu/context.hpp
src/targets/gpu/include/migraphx/gpu/context.hpp
+1
-4
src/targets/gpu/schedule_model.cpp
src/targets/gpu/schedule_model.cpp
+1
-4
tools/include/schedule_model.hpp
tools/include/schedule_model.hpp
+2
-2
No files found.
src/schedule.cpp
View file @
2f7db364
...
...
@@ -209,13 +209,16 @@ struct stream_info
continue
;
}
auto
stream
=
get_stream
(
i
);
if
(
m
.
count
(
stream
)
==
0
)
if
(
m
.
count
(
stream
)
==
0
)
m
[
stream
]
=
i
;
else
m
[
stream
]
=
std
::
min
(
m
[
stream
],
i
,
by
(
std
::
less
<>
{},
[
&
](
auto
x
)
{
return
std
::
distance
(
x
,
start
);
}));
m
[
stream
]
=
std
::
min
(
m
[
stream
],
i
,
by
(
std
::
less
<>
{},
[
&
](
auto
x
)
{
return
std
::
distance
(
x
,
start
);
}));
}
})(
start
);
std
::
transform
(
m
.
begin
(),
m
.
end
(),
std
::
back_inserter
(
result
),
[](
auto
&&
p
)
{
return
p
.
second
;
});
std
::
transform
(
m
.
begin
(),
m
.
end
(),
std
::
back_inserter
(
result
),
[](
auto
&&
p
)
{
return
p
.
second
;
});
return
result
;
}
...
...
@@ -328,11 +331,11 @@ void schedule::apply(program& p) const
// Insert wait instructions
if
(
si
.
is_merge_point
(
ins
,
stream
))
{
for
(
auto
i
:
si
.
get_recorded_instructions
(
ins
))
for
(
auto
i
:
si
.
get_recorded_instructions
(
ins
))
{
if
(
not
si
.
has_stream
(
i
))
if
(
not
si
.
has_stream
(
i
))
continue
;
if
(
stream
==
si
.
get_stream
(
i
))
if
(
stream
==
si
.
get_stream
(
i
))
continue
;
// Create a new event if it hasn't been recorded
if
(
ins2wait
.
count
(
i
)
==
0
)
...
...
src/targets/gpu/include/migraphx/gpu/context.hpp
View file @
2f7db364
...
...
@@ -148,10 +148,7 @@ struct context
events
.
emplace_back
(
create_event
());
}
hipEvent_t
get_event
(
std
::
size_t
i
)
const
{
return
events
.
at
(
i
).
get
();
}
hipEvent_t
get_event
(
std
::
size_t
i
)
const
{
return
events
.
at
(
i
).
get
();
}
std
::
vector
<
argument
>
literals
{};
void
finish
()
const
{
gpu_sync
();
}
...
...
src/targets/gpu/schedule_model.cpp
View file @
2f7db364
...
...
@@ -25,10 +25,7 @@ struct record_event
return
{};
}
void
finalize
(
context
&
ctx
,
const
shape
&
,
std
::
vector
<
shape
>
)
{
ctx
.
create_events
(
event
);
}
void
finalize
(
context
&
ctx
,
const
shape
&
,
std
::
vector
<
shape
>
)
{
ctx
.
create_events
(
event
);
}
};
struct
wait_event
...
...
tools/include/schedule_model.hpp
View file @
2f7db364
...
...
@@ -28,9 +28,9 @@ struct schedule_model
/// Schedule a concurrent instruction
void
sched
(
program
&
p
,
instruction_ref
ins
,
std
::
size_t
n
)
const
;
// Insert necessary waits before an instruction
void
wait
(
program
&
p
,
instruction_ref
ins
,
std
::
size_t
wait_id
)
const
;
void
wait
(
program
&
p
,
instruction_ref
ins
,
std
::
size_t
wait_id
)
const
;
// Insert necessary records after an instruction
void
record
(
program
&
p
,
instruction_ref
ins
,
std
::
size_t
wait_id
)
const
;
void
record
(
program
&
p
,
instruction_ref
ins
,
std
::
size_t
wait_id
)
const
;
/// Compute weights for an operation
std
::
size_t
weight
(
const
operation
&
op
)
const
;
};
...
...
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