2020-01-17 14:28:54 +01:00
|
|
|
//===-- LatencyBenchmarkRunner.h --------------------------------*- C++ -*-===//
|
2018-04-04 11:37:06 +00:00
|
|
|
//
|
2019-01-19 08:50:56 +00:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2018-04-04 11:37:06 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
///
|
|
|
|
/// \file
|
|
|
|
/// A BenchmarkRunner implementation to measure instruction latencies.
|
|
|
|
///
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_TOOLS_LLVM_EXEGESIS_LATENCY_H
|
|
|
|
#define LLVM_TOOLS_LLVM_EXEGESIS_LATENCY_H
|
|
|
|
|
|
|
|
#include "BenchmarkRunner.h"
|
2024-01-19 02:00:33 -08:00
|
|
|
#include "Target.h"
|
2018-04-04 11:37:06 +00:00
|
|
|
|
2018-10-22 17:10:47 +00:00
|
|
|
namespace llvm {
|
2018-04-04 11:37:06 +00:00
|
|
|
namespace exegesis {
|
|
|
|
|
2018-09-13 07:40:53 +00:00
|
|
|
class LatencyBenchmarkRunner : public BenchmarkRunner {
|
|
|
|
public:
|
2023-06-21 00:04:48 +00:00
|
|
|
LatencyBenchmarkRunner(const LLVMState &State, Benchmark::ModeE Mode,
|
|
|
|
BenchmarkPhaseSelectorE BenchmarkPhaseSelector,
|
|
|
|
Benchmark::ResultAggregationModeE ResultAggMode,
|
2023-12-07 00:32:33 -08:00
|
|
|
ExecutionModeE ExecutionMode,
|
2024-01-19 02:00:33 -08:00
|
|
|
ArrayRef<ValidationEvent> ValCounters,
|
2023-12-07 00:32:33 -08:00
|
|
|
unsigned BenchmarkRepeatCount);
|
2018-09-13 07:40:53 +00:00
|
|
|
~LatencyBenchmarkRunner() override;
|
|
|
|
|
|
|
|
private:
|
2019-10-09 11:58:42 +00:00
|
|
|
Expected<std::vector<BenchmarkMeasure>>
|
2018-10-17 15:04:15 +00:00
|
|
|
runMeasurements(const FunctionExecutor &Executor) const override;
|
2020-06-25 11:15:16 -04:00
|
|
|
|
2023-03-27 08:14:18 +00:00
|
|
|
Benchmark::ResultAggregationModeE ResultAggMode;
|
2023-12-07 00:32:33 -08:00
|
|
|
unsigned NumMeasurements;
|
2018-04-04 11:37:06 +00:00
|
|
|
};
|
|
|
|
} // namespace exegesis
|
2018-10-22 17:10:47 +00:00
|
|
|
} // namespace llvm
|
2018-04-04 11:37:06 +00:00
|
|
|
|
|
|
|
#endif // LLVM_TOOLS_LLVM_EXEGESIS_LATENCY_H
|