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
9b34672e
Commit
9b34672e
authored
Apr 17, 2019
by
Shucai Xiao
Browse files
fix a bug surfaced in testing.
parent
c827fbfe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
src/targets/gpu/adjust_allocation.cpp
src/targets/gpu/adjust_allocation.cpp
+8
-5
No files found.
src/targets/gpu/adjust_allocation.cpp
View file @
9b34672e
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
#include <migraphx/instruction.hpp>
#include <migraphx/instruction.hpp>
#include <migraphx/program.hpp>
#include <migraphx/program.hpp>
#include <migraphx/iterator_for.hpp>
#include <migraphx/iterator_for.hpp>
#include <algorithm>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
inline
namespace
MIGRAPHX_INLINE_NS
{
...
@@ -9,16 +10,18 @@ namespace gpu {
...
@@ -9,16 +10,18 @@ namespace gpu {
void
adjust_allocation
::
apply
(
program
&
p
)
const
void
adjust_allocation
::
apply
(
program
&
p
)
const
{
{
std
::
vector
<
std
::
string
>
ins_names
=
{
"gpu::fp_conversion"
};
for
(
auto
ins
:
iterator_for
(
p
))
for
(
auto
ins
:
iterator_for
(
p
))
{
{
// skip instructions not in the set
if
(
std
::
find
(
ins_names
.
begin
(),
ins_names
.
end
(),
ins
->
name
())
==
ins_names
.
end
())
{
continue
;
}
auto
alias_ins
=
instruction
::
get_output_alias
(
ins
,
true
);
auto
alias_ins
=
instruction
::
get_output_alias
(
ins
,
true
);
if
(
alias_ins
->
name
()
==
"hip::allocate"
)
if
(
alias_ins
->
name
()
==
"hip::allocate"
)
{
{
std
::
cout
<<
"===================="
<<
std
::
endl
;
std
::
cout
<<
"ins_name = "
<<
ins
->
name
()
<<
", shape = "
<<
ins
->
get_shape
()
<<
std
::
endl
;
std
::
cout
<<
"alias_ins_name = "
<<
alias_ins
->
name
()
<<
", shape = "
<<
alias_ins
->
get_shape
()
<<
std
::
endl
;
// shape allocated is different from actual shape
// shape allocated is different from actual shape
// of the instruction, reallocate and replace the previous one
// of the instruction, reallocate and replace the previous one
if
(
alias_ins
->
get_shape
()
!=
ins
->
get_shape
())
if
(
alias_ins
->
get_shape
()
!=
ins
->
get_shape
())
...
...
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