Skip to content

Commit

Permalink
Resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
taylding-amd committed Dec 30, 2024
1 parent fad9e4f commit 4ccbb4f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/include/migraphx/program.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 5 additions & 7 deletions src/program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 2 additions & 3 deletions test/ref/add.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,10 @@ TEST_CASE(fp32_fp16_test)
return p;
};

auto test_case = [&](std::vector<std::string>&& op_names) {
auto local_op_names = std::move(op_names);
auto test_case = [&](const std::vector<std::string>& op_names) {
std::vector<float> 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<float> res;
Expand Down

0 comments on commit 4ccbb4f

Please sign in to comment.