Commit 91586757 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

merge changes from the adjust_allocation pass

parents 20190861 08818a51
......@@ -68,6 +68,7 @@ add_library(migraphx_gpu
gather.cpp
lrn.cpp
schedule_model.cpp
adjust_allocation.cpp
)
set_target_properties(migraphx_gpu PROPERTIES EXPORT_NAME gpu)
rocm_clang_tidy_check(migraphx_gpu)
......
......@@ -2,6 +2,10 @@
#include <migraphx/instruction.hpp>
#include <migraphx/program.hpp>
#include <migraphx/iterator_for.hpp>
<<<<<<< HEAD
=======
#include <algorithm>
>>>>>>> adjust_gpu_allocation
namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS {
......@@ -9,8 +13,15 @@ namespace gpu {
void adjust_allocation::apply(program& p) const
{
std::vector<std::string> ins_names = {"gpu::fp_conversion"};
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);
if(alias_ins->name() == "hip::allocate")
{
......
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