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
9cd5cf4e
Commit
9cd5cf4e
authored
Mar 01, 2019
by
Paul
Browse files
Formatting
parent
19ed10f0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
18 deletions
+15
-18
src/targets/gpu/include/migraphx/gpu/context.hpp
src/targets/gpu/include/migraphx/gpu/context.hpp
+8
-6
src/targets/gpu/schedule_model.cpp
src/targets/gpu/schedule_model.cpp
+7
-12
No files found.
src/targets/gpu/include/migraphx/gpu/context.hpp
View file @
9cd5cf4e
...
...
@@ -17,10 +17,9 @@ struct hip_device
{
hip_device
()
{
add_stream
();
}
hip_device
(
std
::
size_t
id
,
std
::
size_t
n
)
:
device_id
(
id
)
hip_device
(
std
::
size_t
id
,
std
::
size_t
n
)
:
device_id
(
id
)
{
for
(
std
::
size_t
i
=
0
;
i
<
n
;
i
++
)
for
(
std
::
size_t
i
=
0
;
i
<
n
;
i
++
)
add_stream
();
}
...
...
@@ -123,7 +122,10 @@ struct hip_device
struct
context
{
context
(
std
::
size_t
device_id
=
0
,
std
::
size_t
n
=
4
)
:
current_device
(
std
::
make_shared
<
hip_device
>
(
device_id
,
n
))
{}
context
(
std
::
size_t
device_id
=
0
,
std
::
size_t
n
=
4
)
:
current_device
(
std
::
make_shared
<
hip_device
>
(
device_id
,
n
))
{
}
hip_device
&
get_current_device
()
{
...
...
src/targets/gpu/schedule_model.cpp
View file @
9cd5cf4e
...
...
@@ -33,16 +33,13 @@ struct wait_event
argument
compute
(
context
&
ctx
,
const
shape
&
,
const
std
::
vector
<
argument
>&
)
const
{
assert
(
event
!=
nullptr
);
for
(
auto
n
:
wait_for
)
for
(
auto
n
:
wait_for
)
ctx
.
get_stream
(
n
).
record
(
event
.
get
());
ctx
.
get_stream
().
wait
(
event
.
get
());
return
{};
}
void
finalize
(
context
&
ctx
,
const
shape
&
,
std
::
vector
<
shape
>
)
{
event
=
create_event
();
}
void
finalize
(
context
&
ctx
,
const
shape
&
,
std
::
vector
<
shape
>
)
{
event
=
create_event
();
}
};
struct
set_stream
...
...
@@ -79,7 +76,6 @@ void schedule_model::wait(program& p,
p
.
insert_instruction
(
ins
,
wait_event
{
wait_for
});
}
static
std
::
unordered_map
<
std
::
string
,
std
::
size_t
>
create_weight_map
()
{
return
{
...
...
@@ -100,10 +96,9 @@ static const std::unordered_map<std::string, std::size_t>& weight_map()
return
m
;
}
std
::
size_t
schedule_model
::
weight
(
const
operation
&
op
)
const
{
if
(
weight_map
().
count
(
op
.
name
())
==
0
)
if
(
weight_map
().
count
(
op
.
name
())
==
0
)
return
0
;
return
weight_map
().
at
(
op
.
name
());
}
...
...
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