#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace migraphx { inline namespace MIGRAPHX_INLINE_NS { namespace gpu { MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_ENABLE_SCHEDULE_PASS) std::vector target::get_passes(migraphx::context& gctx) const { auto& ctx = any_cast(gctx); // clang-format off return { dead_code_elimination{}, simplify_reshapes{}, dead_code_elimination{}, eliminate_identity{}, eliminate_pad{}, dead_code_elimination{}, rewrite_batchnorm{}, dead_code_elimination{}, rewrite_rnn{}, rewrite_pooling{}, dead_code_elimination{}, // common_subexpression_elimination{}, // dead_code_elimination{}, simplify_algebra{}, dead_code_elimination{}, auto_contiguous{}, simplify_reshapes{}, dead_code_elimination{}, propagate_constant{}, dead_code_elimination{}, lowering{ctx}, eliminate_concat{concat_gpu_optimization{}}, dead_code_elimination{}, eliminate_contiguous{}, dead_code_elimination{}, adjust_allocation{}, dead_code_elimination{}, pack_int8_args{}, dead_code_elimination{}, fuse_ops{&ctx}, dead_code_elimination{}, write_literals{&ctx}, schedule{gpu::schedule_model{ctx.get_current_device().nstreams()}, enabled(MIGRAPHX_ENABLE_SCHEDULE_PASS{})}, memory_coloring{"hip::allocate"}, dead_code_elimination{}, eliminate_workspace{}, eliminate_allocation{"hip::allocate"}, check_context{}, dead_code_elimination{}, eliminate_identity{} }; // clang-format on } std::string target::name() const { return "miopen"; } migraphx::context target::get_context() const { return context{}; } argument target::copy_to(const argument& arg) const { return gpu::to_gpu(arg); } argument target::copy_from(const argument& arg) const { return gpu::from_gpu(arg); } argument target::allocate(const shape& s) const { return gpu::allocate_gpu(s); } } // namespace gpu } // namespace MIGRAPHX_INLINE_NS } // namespace migraphx