Commit 4603ec96 authored by Paul's avatar Paul
Browse files

Fix clang tidy issues

parent dc60c09f
......@@ -13,7 +13,7 @@ constexpr T normalize(unsigned long z)
if(z == 0)
return 0;
const auto max = 32768;
const double range = max / 2;
const double range = max / 2; // NOLINT
double result = (z % max) / range;
result -= 1;
return result;
......
......@@ -5,9 +5,9 @@ namespace migraph {
namespace gpu {
namespace device {
void add(argument result, argument arg1, argument arg2)
void add(const argument& result, const argument& arg1, const argument& arg2)
{
nary(std::move(result), std::move(arg1), std::move(arg2))([](auto x, auto y) { return x + y; });
nary(result, arg1, arg2)([](auto x, auto y) { return x + y; });
}
} // namespace device
......
......@@ -5,9 +5,9 @@ namespace migraph {
namespace gpu {
namespace device {
void add_relu(argument result, argument arg1, argument arg2)
void add_relu(const argument& result, const argument& arg1, const argument& arg2)
{
nary(std::move(result), std::move(arg1), std::move(arg2))(
nary(result, arg1, arg2)(
[](auto x, auto y) { return std::max<decltype(x + y)>(0, x + y); });
}
......
......@@ -57,7 +57,7 @@ auto nary_nonstandard(argument result, Arguments... args)
return [=](auto f) { return nary_nonstandard_impl(f, result, args...); };
}
inline auto binary_broadcast_vec(argument result, argument arg1, argument arg2)
inline auto binary_broadcast_vec(const argument& result, const argument& arg1, const argument& arg2)
{
return [=](auto f) {
const auto& output_shape = result.get_shape();
......@@ -109,7 +109,7 @@ inline auto binary_broadcast_vec(argument result, argument arg1, argument arg2)
};
}
inline auto binary_broadcast(argument result, argument arg1, argument arg2)
inline auto binary_broadcast(const argument& result, const argument& arg1, const argument& arg2)
{
return [=](auto f) {
const auto& output_shape = result.get_shape();
......@@ -217,7 +217,7 @@ auto nary(argument result, Arguments... args)
return nary_impl(result, args...);
}
inline auto nary(argument result, argument arg1, argument arg2)
inline auto nary(const argument& result, const argument& arg1, const argument& arg2)
{
return [=](auto f) {
// TODO: Check result and arg1 shape is the same
......
......@@ -8,7 +8,7 @@ namespace migraph {
namespace gpu {
namespace device {
void add(argument result, argument arg1, argument arg2);
void add(const argument& result, const argument& arg1, const argument& arg2);
} // namespace device
} // namespace gpu
......
......@@ -8,7 +8,7 @@ namespace migraph {
namespace gpu {
namespace device {
void add_relu(argument result, argument arg1, argument arg2);
void add_relu(const argument& result, const argument& arg1, const argument& arg2);
} // namespace device
} // namespace gpu
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment