From 4ccbb4f9bb87945e7ad8518471c3865dc8cd9385 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 30 Dec 2024 17:37:22 -0500 Subject: [PATCH] Resolve comments --- src/include/migraphx/program.hpp | 2 +- src/program.cpp | 12 +++++------- test/ref/add.cpp | 5 ++--- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/include/migraphx/program.hpp b/src/include/migraphx/program.hpp index 87de258a44b..2a82f381c21 100644 --- a/src/include/migraphx/program.hpp +++ b/src/include/migraphx/program.hpp @@ -112,7 +112,7 @@ struct MIGRAPHX_EXPORT program std::size_t batch = 1, bool detailed = false) const; - void mark(const parameter_map& params, marker&& m); + void mark(const parameter_map& params, marker m); value to_value() const; void from_value(const value& v); diff --git a/src/program.cpp b/src/program.cpp index dd21cad557d..5cfb62baf39 100644 --- a/src/program.cpp +++ b/src/program.cpp @@ -887,23 +887,21 @@ std::string perf_group(instruction_ref ins, bool detailed) return result; } -void program::mark(const parameter_map& params, marker&& m) +void program::mark(const parameter_map& params, marker m) { auto& ctx = this->impl->contexts; // Run once by itself eval(params); this->finish(); - // Start marking - auto moved_marker = std::move(m); - moved_marker.mark_start(*this); + m.mark_start(*this); generic_eval(*this, ctx, params, [&](auto ins, auto f) { argument result; - moved_marker.mark_start(ins); + m.mark_start(ins); result = f(); - moved_marker.mark_stop(ins); + m.mark_stop(ins); return result; }); - moved_marker.mark_stop(*this); + m.mark_stop(*this); } void program::perf_report( diff --git a/test/ref/add.cpp b/test/ref/add.cpp index 4ae73466847..148e9b5b08a 100644 --- a/test/ref/add.cpp +++ b/test/ref/add.cpp @@ -170,11 +170,10 @@ TEST_CASE(fp32_fp16_test) return p; }; - auto test_case = [&](std::vector&& op_names) { - auto local_op_names = std::move(op_names); + auto test_case = [&](const std::vector& op_names) { std::vector gold_res = {2.0, 4.0, 6.0, 8.0, 10.0, 12.0}; auto p = create_program(); - migraphx::quantize_fp16(p, local_op_names); + migraphx::quantize_fp16(p, op_names); p.compile(migraphx::make_target("ref")); auto result = p.eval({}).back(); std::vector res;