Commit e27adf86 authored by Paul's avatar Paul
Browse files

Enable cse on the gpu

parent bb3a1061
......@@ -4,6 +4,7 @@
#include <migraph/context.hpp>
#include <migraph/errors.hpp>
#include <migraph/argument.hpp>
#include <migraph/reflect.hpp>
namespace migraph {
......@@ -22,6 +23,13 @@ struct literal
struct outline
{
shape s;
template <class Self, class F>
static auto reflect(Self& self, F f)
{
return pack(f(self.s, "shape"));
}
std::string name() const { return "@outline"; }
shape compute_shape(const std::vector<shape>&) const { return s; }
argument compute(context&, const shape&, const std::vector<argument>&) const
......@@ -33,6 +41,13 @@ struct outline
struct param
{
std::string parameter;
template <class Self, class F>
static auto reflect(Self& self, F f)
{
return pack(f(self.parameter, "parameter"));
}
std::string name() const { return "@param"; }
shape compute_shape(const std::vector<shape>&) const { MIGRAPH_THROW("builtin"); }
argument compute(context&, const shape&, const std::vector<argument>&) const
......
......@@ -13,6 +13,7 @@
#include <migraph/simplify_algebra.hpp>
#include <migraph/constant_propagate.hpp>
#include <migraph/eliminate_contiguous.hpp>
#include <migraph/common_subexpression_elimination.hpp>
#include <migraph/fwd_conv_batchnorm_rewrite.hpp>
namespace migraph {
......@@ -27,6 +28,8 @@ std::vector<pass> target::get_passes(migraph::context& gctx) const
dead_code_elimination{},
fwd_conv_batchnorm_rewrite{},
dead_code_elimination{},
common_subexpression_elimination{},
dead_code_elimination{},
simplify_algebra{},
dead_code_elimination{},
constant_propagate{},
......
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