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

Fixed multilevel pointer conversion tidy check errors and re-enable t… #3615

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ rocm_enable_clang_tidy(
-bugprone-easily-swappable-parameters
-bugprone-implicit-widening-of-multiplication-result
-bugprone-macro-parentheses
-bugprone-multi-level-implicit-pointer-conversion
-bugprone-signed-char-misuse
-bugprone-unchecked-optional-access
# Disable the aliased reserved identifiers
Expand Down
4 changes: 2 additions & 2 deletions src/targets/cpu/include/migraphx/cpu/dnnl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ struct dnnl_op : auto_register_op<Derived>
auto desc = prim.get_primitive_desc();
const char* str = nullptr;
#ifdef MIGRAPHX_ENABLE_ZENDNN
zendnn_primitive_desc_query(desc, zendnn_query_impl_info_str, 0, &str);
zendnn_primitive_desc_query(desc, zendnn_query_impl_info_str, 0, reinterpret_cast<void*>(&str));
#else
dnnl_primitive_desc_query(desc, dnnl_query_impl_info_str, 0, &str);
dnnl_primitive_desc_query(desc, dnnl_query_impl_info_str, 0, reinterpret_cast<void*>(&str));
#endif
return str == nullptr ? "" : str;
}
Expand Down
2 changes: 1 addition & 1 deletion src/targets/gpu/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void kernel::launch(hipStream_t stream,
hipEvent_t stop) const
{
assert(impl != nullptr);
void* kernargs = args.data();
void* kernargs = reinterpret_cast<void*>(args.data());
Copy link
Collaborator

Choose a reason for hiding this comment

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

This makes sense here.

std::size_t size = args.size() * sizeof(void*);

launch_kernel(impl->fun, stream, global, local, kernargs, size, start, stop);
Expand Down
10 changes: 9 additions & 1 deletion test/include/test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,15 @@ struct lhs_expression
std::string op = Operator::as_string();
if(not op.empty())
s << Operator::as_string() << " ";
s << self.lhs;
if constexpr(std::is_pointer_v<decltype(self.lhs)>)
{
s << static_cast<void*>(self.lhs);
}
else
{
// NOLINTNEXTLINE
s << self.lhs;
}
return s;
}

Expand Down
Loading