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
3689dab0
Unverified
Commit
3689dab0
authored
Feb 18, 2019
by
Paul Fultz II
Committed by
GitHub
Feb 18, 2019
Browse files
Merge pull request #180 from ROCmSoftwarePlatform/remove_outline_allocate
Remove outline allocate
parents
12d83996
61783a3f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
12 deletions
+9
-12
src/opt/memory_coloring_impl.cpp
src/opt/memory_coloring_impl.cpp
+1
-2
src/targets/gpu/include/migraphx/gpu/hip.hpp
src/targets/gpu/include/migraphx/gpu/hip.hpp
+3
-2
src/targets/gpu/lowering.cpp
src/targets/gpu/lowering.cpp
+1
-2
src/targets/gpu/write_literals.cpp
src/targets/gpu/write_literals.cpp
+1
-2
test/memory_coloring_test.cpp
test/memory_coloring_test.cpp
+3
-4
No files found.
src/opt/memory_coloring_impl.cpp
View file @
3689dab0
...
@@ -203,9 +203,8 @@ void memory_coloring_impl::rewrite()
...
@@ -203,9 +203,8 @@ void memory_coloring_impl::rewrite()
if
(
is_allocate
(
ins
))
if
(
is_allocate
(
ins
))
{
{
assert
(
!
ins
->
inputs
().
empty
());
p_program
->
replace_instruction
(
p_program
->
replace_instruction
(
ins
,
op
::
load
{
ins
->
inputs
().
at
(
0
)
->
get_shape
(),
offset
},
scratch_param
);
ins
,
op
::
load
{
ins
->
get_shape
(),
offset
},
scratch_param
);
}
}
else
if
(
is_literal
(
ins
))
else
if
(
is_literal
(
ins
))
{
{
...
...
src/targets/gpu/include/migraphx/gpu/hip.hpp
View file @
3689dab0
...
@@ -23,12 +23,13 @@ void copy_to_gpu(const argument& src, const argument& dst);
...
@@ -23,12 +23,13 @@ void copy_to_gpu(const argument& src, const argument& dst);
struct
hip_allocate
struct
hip_allocate
{
{
shape
s
;
std
::
string
tag
{};
std
::
string
tag
{};
std
::
string
name
()
const
{
return
"hip::allocate"
;
}
std
::
string
name
()
const
{
return
"hip::allocate"
;
}
shape
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
shape
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
{
{
check_shapes
{
inputs
}.
has
(
1
);
check_shapes
{
inputs
}.
has
(
0
);
return
inputs
.
front
()
;
return
s
;
}
}
argument
compute
(
context
&
,
const
shape
&
output_shape
,
const
std
::
vector
<
argument
>&
)
const
argument
compute
(
context
&
,
const
shape
&
output_shape
,
const
std
::
vector
<
argument
>&
)
const
{
{
...
...
src/targets/gpu/lowering.cpp
View file @
3689dab0
...
@@ -127,8 +127,7 @@ struct miopen_apply
...
@@ -127,8 +127,7 @@ struct miopen_apply
}
}
else
else
{
{
auto
is
=
prog
->
add_outline
(
s
);
auto
result
=
prog
->
insert_instruction
(
ins
,
hip_allocate
{
s
,
std
::
move
(
tag
)});
auto
result
=
prog
->
insert_instruction
(
ins
,
hip_allocate
{
std
::
move
(
tag
)},
is
);
return
result
;
return
result
;
}
}
}
}
...
...
src/targets/gpu/write_literals.cpp
View file @
3689dab0
...
@@ -37,8 +37,7 @@ void write_literals::apply(program& p) const
...
@@ -37,8 +37,7 @@ void write_literals::apply(program& p) const
{
{
literal
l
=
ins
->
get_literal
();
literal
l
=
ins
->
get_literal
();
auto
pre
=
p
.
add_literal
(
l
);
auto
pre
=
p
.
add_literal
(
l
);
auto
s
=
p
.
add_outline
(
l
.
get_shape
());
auto
alloc
=
p
.
insert_instruction
(
std
::
next
(
pre
),
hip_allocate
{
l
.
get_shape
()});
auto
alloc
=
p
.
insert_instruction
(
std
::
next
(
pre
),
hip_allocate
{},
s
);
p
.
replace_instruction
(
ins
,
hip_copy
{},
pre
,
alloc
);
p
.
replace_instruction
(
ins
,
hip_copy
{},
pre
,
alloc
);
}
}
else
else
...
...
test/memory_coloring_test.cpp
View file @
3689dab0
...
@@ -21,8 +21,8 @@ struct allocate
...
@@ -21,8 +21,8 @@ struct allocate
std
::
string
name
()
const
{
return
"allocate"
;
}
std
::
string
name
()
const
{
return
"allocate"
;
}
migraphx
::
shape
compute_shape
(
const
std
::
vector
<
migraphx
::
shape
>&
inputs
)
const
migraphx
::
shape
compute_shape
(
const
std
::
vector
<
migraphx
::
shape
>&
inputs
)
const
{
{
migraphx
::
check_shapes
{
inputs
,
*
this
}.
has
(
1
);
migraphx
::
check_shapes
{
inputs
,
*
this
}.
has
(
0
);
return
inputs
.
front
()
;
return
s
;
}
}
migraphx
::
argument
compute
(
migraphx
::
context
&
,
migraphx
::
argument
compute
(
migraphx
::
context
&
,
const
migraphx
::
shape
&
output_shape
,
const
migraphx
::
shape
&
output_shape
,
...
@@ -34,8 +34,7 @@ struct allocate
...
@@ -34,8 +34,7 @@ struct allocate
migraphx
::
instruction_ref
add_alloc
(
migraphx
::
program
&
p
,
const
migraphx
::
shape
&
s
)
migraphx
::
instruction_ref
add_alloc
(
migraphx
::
program
&
p
,
const
migraphx
::
shape
&
s
)
{
{
auto
a0
=
p
.
add_outline
(
s
);
return
p
.
add_instruction
(
allocate
{
s
});
return
p
.
add_instruction
(
allocate
{},
a0
);
}
}
bool
no_allocate
(
const
migraphx
::
program
&
p
)
bool
no_allocate
(
const
migraphx
::
program
&
p
)
...
...
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