Skip to content

Commit

Permalink
Apply clang-format (ROCm#1530)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Ulmer authored Jun 10, 2022
1 parent fcae3f0 commit 11c4619
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
18 changes: 12 additions & 6 deletions Tensile/Source/lib/include/Tensile/Distance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,18 @@ namespace Tensile
// If incoming_size falls inside grid boundary (32768 in this case), searching toward larger M,N.
// If incoming_N > 32768, searching toward larger M and nearest boundary.
// IF incoming_M > 32768, searching toward larger N and nearest boundary.
double stepM = (p1[0] <= 32768)? std::ceil(p1[0] / M): 1;
double stepN = (p1[1] <= 32768)? std::ceil(p1[1] / N): 1;
if (p1[0] <= 32768 && p1[1] <= 32768) {
distance = std::round(100 * stepM * stepN / std::pow((p1[0] * p1[1]) / (stepM * M * stepN * N),2) );
} else {
distance = std::round(10000 * stepM * stepN * std::pow(std::pow(p1[0] - p2[0],2) + std::pow(p1[1] - p2[1],2),0.5));
double stepM = (p1[0] <= 32768) ? std::ceil(p1[0] / M) : 1;
double stepN = (p1[1] <= 32768) ? std::ceil(p1[1] / N) : 1;
if(p1[0] <= 32768 && p1[1] <= 32768)
{
distance = std::round(100 * stepM * stepN
/ std::pow((p1[0] * p1[1]) / (stepM * M * stepN * N), 2));
}
else
{
distance = std::round(
10000 * stepM * stepN
* std::pow(std::pow(p1[0] - p2[0], 2) + std::pow(p1[1] - p2[1], 2), 0.5));
}
// and nearest K
distance += (std::abs(K - p1[2]) / (K + p1[2] * 8));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ namespace Tensile
}
else if(distanceType == "GridBased")
{
success
= mappingDistance<Key, Matching::GridBasedDistance<Key>>(io, lib, properties);
success = mappingDistance<Key, Matching::GridBasedDistance<Key>>(
io, lib, properties);
}
else
{
Expand Down

0 comments on commit 11c4619

Please sign in to comment.