Commit af7b5f89 authored by Paul's avatar Paul
Browse files

Update miopen target for passes

parent 45bdfaa0
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <migraph/dfor.hpp> #include <migraph/dfor.hpp>
#include <migraph/operators.hpp> #include <migraph/operators.hpp>
#include <migraph/shape_for_each.hpp> #include <migraph/shape_for_each.hpp>
#include <migraph/iterator_for.hpp>
namespace migraph { namespace migraph {
namespace cpu { namespace cpu {
...@@ -491,7 +492,7 @@ struct cpu_apply ...@@ -491,7 +492,7 @@ struct cpu_apply
void apply() void apply()
{ {
init(); init();
for(auto it = prog->begin(); it != prog->end(); it++) for(auto it:iterator_for(*prog))
{ {
if(it->op.name() == "activation") if(it->op.name() == "activation")
{ {
......
...@@ -9,7 +9,7 @@ namespace miopen { ...@@ -9,7 +9,7 @@ namespace miopen {
struct miopen_target struct miopen_target
{ {
std::string name() const; std::string name() const;
void apply(program& p) const; std::vector<pass> get_passes(context& ctx) const;
context get_context() const; context get_context() const;
}; };
......
...@@ -299,9 +299,16 @@ struct miopen_apply ...@@ -299,9 +299,16 @@ struct miopen_apply
} }
}; };
std::string miopen_target::name() const { return "miopen"; } struct miopen_pass
{
std::string name() const { return "miopen::pass"; }
void apply(program& p) const { miopen_apply{&p}.apply(); }
};
std::vector<pass> miopen_target::get_passes(context&) const { return {miopen_pass{}}; }
void miopen_target::apply(program& p) const { miopen_apply{&p}.apply(); } std::string miopen_target::name() const { return "miopen"; }
context miopen_target::get_context() const context miopen_target::get_context() const
{ {
......
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