Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable cpp core guidlines checks. #3723

Merged
merged 9 commits into from
Jan 4, 2025
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ rocm_enable_clang_tidy(
-cppcoreguidelines-pro-type-reinterpret-cast
-cppcoreguidelines-pro-type-union-access
-cppcoreguidelines-pro-type-vararg
-cppcoreguidelines-rvalue-reference-param-not-moved
-cppcoreguidelines-special-member-functions
-cppcoreguidelines-use-default-member-init
-cppcoreguidelines-virtual-class-destructor
Expand Down
9 changes: 5 additions & 4 deletions src/program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -894,15 +894,16 @@ void program::mark(const parameter_map& params, marker&& m)
eval(params);
this->finish();
// Start marking
m.mark_start(*this);
auto moved_marker = std::move(m);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take the marker by value instead of forcing a move.

moved_marker.mark_start(*this);
generic_eval(*this, ctx, params, [&](auto ins, auto f) {
argument result;
m.mark_start(ins);
moved_marker.mark_start(ins);
result = f();
m.mark_stop(ins);
moved_marker.mark_stop(ins);
return result;
});
m.mark_stop(*this);
moved_marker.mark_stop(*this);
}

void program::perf_report(
Expand Down
3 changes: 2 additions & 1 deletion test/ref/add.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,10 @@ TEST_CASE(fp32_fp16_test)
};

auto test_case = [&](std::vector<std::string>&& op_names) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parameter should be const-ref.

auto local_op_names = std::move(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, op_names);
migraphx::quantize_fp16(p, local_op_names);
p.compile(migraphx::make_target("ref"));
auto result = p.eval({}).back();
std::vector<float> res;
Expand Down
Loading