aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--llvm/tools/llvm-exegesis/lib/Clustering.cpp11
-rw-r--r--llvm/tools/llvm-exegesis/lib/Clustering.h9
2 files changed, 8 insertions, 12 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/Clustering.cpp b/llvm/tools/llvm-exegesis/lib/Clustering.cpp
index df45de3..360966a 100644
--- a/llvm/tools/llvm-exegesis/lib/Clustering.cpp
+++ b/llvm/tools/llvm-exegesis/lib/Clustering.cpp
@@ -49,17 +49,6 @@ void InstructionBenchmarkClustering::rangeQuery(
}
}
-bool InstructionBenchmarkClustering::isNeighbour(
- const std::vector<BenchmarkMeasure> &P,
- const std::vector<BenchmarkMeasure> &Q) const {
- double DistanceSquared = 0.0;
- for (size_t I = 0, E = P.size(); I < E; ++I) {
- const auto Diff = P[I].PerInstructionValue - Q[I].PerInstructionValue;
- DistanceSquared += Diff * Diff;
- }
- return DistanceSquared <= EpsilonSquared_;
-}
-
InstructionBenchmarkClustering::InstructionBenchmarkClustering(
const std::vector<InstructionBenchmark> &Points,
const double EpsilonSquared)
diff --git a/llvm/tools/llvm-exegesis/lib/Clustering.h b/llvm/tools/llvm-exegesis/lib/Clustering.h
index e746e4b..297651c 100644
--- a/llvm/tools/llvm-exegesis/lib/Clustering.h
+++ b/llvm/tools/llvm-exegesis/lib/Clustering.h
@@ -90,7 +90,14 @@ public:
// Returns true if the given point is within a distance Epsilon of each other.
bool isNeighbour(const std::vector<BenchmarkMeasure> &P,
- const std::vector<BenchmarkMeasure> &Q) const;
+ const std::vector<BenchmarkMeasure> &Q) const {
+ double DistanceSquared = 0.0;
+ for (size_t I = 0, E = P.size(); I < E; ++I) {
+ const auto Diff = P[I].PerInstructionValue - Q[I].PerInstructionValue;
+ DistanceSquared += Diff * Diff;
+ }
+ return DistanceSquared <= EpsilonSquared_;
+ }
private:
InstructionBenchmarkClustering(