| 1 | //===-- ResultAggregator.h --------------------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | /// |
| 9 | /// \file |
| 10 | /// Defines result aggregators that are used to aggregate the results from |
| 11 | /// multiple full benchmark runs. |
| 12 | /// |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #include "BenchmarkResult.h" |
| 16 | |
| 17 | namespace llvm { |
| 18 | namespace exegesis { |
| 19 | |
| 20 | class ResultAggregator { |
| 21 | public: |
| 22 | static std::unique_ptr<ResultAggregator> |
| 23 | CreateAggregator(Benchmark::RepetitionModeE RepetitionMode); |
| 24 | |
| 25 | virtual void AggregateResults(Benchmark &Result, |
| 26 | ArrayRef<Benchmark> OtherResults) const; |
| 27 | virtual void AggregateMeasurement(BenchmarkMeasure &Measurement, |
| 28 | const BenchmarkMeasure &NewMeasurement, |
| 29 | const Benchmark &Result) const = 0; |
| 30 | |
| 31 | virtual ~ResultAggregator() = default; |
| 32 | }; |
| 33 | |
| 34 | } // namespace exegesis |
| 35 | } // namespace llvm |
| 36 | |