Commit e40a8f31 authored by mei-ye's avatar mei-ye
Browse files

merge with master

parent ab567439
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
namespace migraph { namespace migraph {
namespace gpu { namespace gpu {
std::vector<pass> target::get_passes(migraph::context& gctx) const std::vector<pass> target::get_passes(migraph::context& gctx) const
{ {
auto& ctx = any_cast<context>(gctx); auto& ctx = any_cast<context>(gctx);
...@@ -50,9 +50,9 @@ std::string target::name() const { return "miopen"; } ...@@ -50,9 +50,9 @@ std::string target::name() const { return "miopen"; }
migraph::context target::get_context(parameter_map params) const migraph::context target::get_context(parameter_map params) const
{ {
return context{share(make_obj<miopen_handle>(&miopenCreate)), return context{share(make_obj<miopen_handle>(&miopenCreate)),
share(create_rocblas_handle_ptr()), params, {}}; share(create_rocblas_handle_ptr()),
params,
{}};
} }
} // namespace gpu } // namespace gpu
} // namespace migraph } // namespace migraph
...@@ -26,9 +26,9 @@ struct hip_load_literal ...@@ -26,9 +26,9 @@ struct hip_load_literal
void write_literals::apply(program& p) const void write_literals::apply(program& p) const
{ {
if (!enabled(MIGRAPH_DISABLE_MEMORY_COLORING{})) if(!enabled(MIGRAPH_DISABLE_MEMORY_COLORING{}))
return; return;
assert(ctx != nullptr); assert(ctx != nullptr);
for(auto ins : iterator_for(p)) for(auto ins : iterator_for(p))
{ {
...@@ -41,7 +41,5 @@ void write_literals::apply(program& p) const ...@@ -41,7 +41,5 @@ void write_literals::apply(program& p) const
} }
} }
} }
} // namespace gpu } // namespace gpu
} // namespace migraph } // namespace migraph
...@@ -10,7 +10,7 @@ struct contiguous_target ...@@ -10,7 +10,7 @@ struct contiguous_target
{ {
return {migraph::auto_contiguous{}}; return {migraph::auto_contiguous{}};
} }
migraph::context get_context() const { return {}; } migraph::context get_context(migraph::parameter_map) const { return {}; }
}; };
void literal_broadcast() void literal_broadcast()
......
...@@ -9,7 +9,7 @@ struct dce_target ...@@ -9,7 +9,7 @@ struct dce_target
{ {
return {migraph::dead_code_elimination{}}; return {migraph::dead_code_elimination{}};
} }
migraph::context get_context() const { return {}; } migraph::context get_context(migraph::parameter_map) const { return {}; }
}; };
void simple_test() void simple_test()
......
...@@ -12,7 +12,7 @@ struct eliminate_allocation_target ...@@ -12,7 +12,7 @@ struct eliminate_allocation_target
{ {
return {migraph::eliminate_allocation{"allocate", align}, migraph::dead_code_elimination{}}; return {migraph::eliminate_allocation{"allocate", align}, migraph::dead_code_elimination{}};
} }
migraph::context get_context() const { return {}; } migraph::context get_context(migraph::parameter_map) const { return {}; }
}; };
struct allocate struct allocate
......
#include <migraph/memory_coloring.hpp>
#include <migraph/operators.hpp>
#include <basic_ops.hpp>
#include <test.hpp>
struct memory_coloring_target
{
std::string name() const { return "memory_coloring"; }
std::vector<migraph::pass> get_passes(migraph::context&) const
{
return {migraph::memory_coloring{}};
}
migraph::context get_context(migraph::parameter_map) const { return {}; }
};
int main()
{
migraph::program p;
auto l = p.add_literal(get_2x2());
p.add_instruction(migraph::transpose{{1, 0}}, l);
p.compile(memory_coloring_target{});
EXPECT(p.get_parameter_shape("scratch").bytes() == 16);
}
...@@ -11,7 +11,7 @@ struct simplify_reshapes_target ...@@ -11,7 +11,7 @@ struct simplify_reshapes_target
{ {
return {migraph::simplify_reshapes{}, migraph::dead_code_elimination{}}; return {migraph::simplify_reshapes{}, migraph::dead_code_elimination{}};
} }
migraph::context get_context() const { return {}; } migraph::context get_context(migraph::parameter_map) const { return {}; }
}; };
void double_contig() void double_contig()
......
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