"vscode:/vscode.git/clone" did not exist on "2fdf510d05a11280fff4688aa231491be98ef8d6"
Commit 9b34672e authored by Shucai Xiao's avatar Shucai Xiao
Browse files

fix a bug surfaced in testing.

parent c827fbfe
...@@ -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())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment