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
6c7065c3
Commit
6c7065c3
authored
Mar 05, 2019
by
Paul
Browse files
Dont schedule in wait
parent
d416bfe4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
7 deletions
+6
-7
src/schedule.cpp
src/schedule.cpp
+1
-2
src/targets/gpu/include/migraphx/gpu/schedule_model.hpp
src/targets/gpu/include/migraphx/gpu/schedule_model.hpp
+1
-1
src/targets/gpu/schedule_model.cpp
src/targets/gpu/schedule_model.cpp
+2
-2
test/schedule_test.cpp
test/schedule_test.cpp
+2
-2
No files found.
src/schedule.cpp
View file @
6c7065c3
...
...
@@ -264,10 +264,9 @@ void schedule::apply(program& p) const
if
(
not
si
.
has_stream
(
ins
))
continue
;
auto
stream
=
si
.
get_stream
(
ins
);
model
.
schedule_instruction
(
p
,
ins
,
stream
);
if
(
si
.
is_merge_point
(
ins
,
stream
))
model
.
wait
(
p
,
ins
,
stream
,
si
.
wait_for
(
ins
));
else
model
.
schedule_instruction
(
p
,
ins
,
stream
);
}
// Add memory conflicts
...
...
src/targets/gpu/include/migraphx/gpu/schedule_model.hpp
View file @
6c7065c3
...
...
@@ -20,7 +20,7 @@ struct schedule_model
void
schedule_instruction
(
program
&
p
,
instruction_ref
ins
,
std
::
size_t
n
)
const
;
void
wait
(
program
&
p
,
instruction_ref
ins
,
std
::
size_t
wait_on
,
std
::
size_t
,
const
std
::
vector
<
std
::
size_t
>&
wait_for
)
const
;
std
::
size_t
weight
(
const
operation
&
op
)
const
;
};
...
...
src/targets/gpu/schedule_model.cpp
View file @
6c7065c3
...
...
@@ -51,6 +51,7 @@ struct wait_event
return
i
==
ctx
.
get_current_device
().
stream_id
();
}));
(
void
)
ctx
;
assert
(
not
wait_for
.
empty
());
event
=
create_event
();
}
};
...
...
@@ -91,10 +92,9 @@ void schedule_model::schedule_instruction(program& p, instruction_ref ins, std::
}
void
schedule_model
::
wait
(
program
&
p
,
instruction_ref
ins
,
std
::
size_t
wait_on
,
std
::
size_t
,
const
std
::
vector
<
std
::
size_t
>&
wait_for
)
const
{
this
->
schedule_instruction
(
p
,
ins
,
wait_on
);
p
.
insert_instruction
(
ins
,
wait_event
{
wait_for
});
}
...
...
test/schedule_test.cpp
View file @
6c7065c3
...
...
@@ -62,6 +62,7 @@ struct wait_event
const
migraphx
::
shape
&
,
const
std
::
vector
<
migraphx
::
argument
>&
)
const
{
assert
(
not
wait_for
.
empty
());
return
{};
}
};
...
...
@@ -79,10 +80,9 @@ struct schedule_model_test
}
void
wait
(
migraphx
::
program
&
p
,
migraphx
::
instruction_ref
ins
,
std
::
size_t
wait_on
,
std
::
size_t
,
const
std
::
vector
<
std
::
size_t
>&
wait_for
)
const
{
(
*
ins2stream
)[
ins
]
=
wait_on
;
p
.
insert_instruction
(
ins
,
wait_event
{
wait_for
});
}
std
::
size_t
weight
(
const
migraphx
::
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