Commit 458ec149 authored by Paul's avatar Paul
Browse files

Add an env var to enable the scheduler

parent 8b6a5cda
......@@ -17,6 +17,7 @@ struct program;
struct schedule
{
schedule_model model{};
bool enable = true;
std::string name() const { return "schedule"; }
void apply(program& p) const;
};
......
......@@ -341,6 +341,8 @@ struct stream_info
void schedule::apply(program& p) const
{
if (not enable)
return;
stream_info si;
auto last = std::prev(p.end());
si.accumulate_weights(last, model);
......
......@@ -25,6 +25,8 @@ namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS {
namespace gpu {
MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_ENABLE_SCHEDULE_PASS)
std::vector<pass> target::get_passes(migraphx::context& gctx) const
{
auto& ctx = any_cast<context>(gctx);
......@@ -53,7 +55,7 @@ std::vector<pass> target::get_passes(migraphx::context& gctx) const
fuse_ops{&ctx},
dead_code_elimination{},
write_literals{&ctx},
schedule{gpu::schedule_model{ctx.get_current_device().nstreams()}},
schedule{gpu::schedule_model{ctx.get_current_device().nstreams()}, enabled(MIGRAPHX_ENABLE_SCHEDULE_PASS{})},
memory_coloring{"hip::allocate"},
dead_code_elimination{},
eliminate_workspace{},
......
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