LatencyBenchmarkRunner.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //===-- LatencyBenchmarkRunner.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. /// A BenchmarkRunner implementation to measure instruction latencies.
  11. ///
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_TOOLS_LLVM_EXEGESIS_LATENCY_H
  14. #define LLVM_TOOLS_LLVM_EXEGESIS_LATENCY_H
  15. #include "BenchmarkRunner.h"
  16. namespace llvm {
  17. namespace exegesis {
  18. class LatencyBenchmarkRunner : public BenchmarkRunner {
  19. public:
  20. LatencyBenchmarkRunner(
  21. const LLVMState &State, InstructionBenchmark::ModeE Mode,
  22. InstructionBenchmark::ResultAggregationModeE ResultAggMode);
  23. ~LatencyBenchmarkRunner() override;
  24. private:
  25. Expected<std::vector<BenchmarkMeasure>>
  26. runMeasurements(const FunctionExecutor &Executor) const override;
  27. InstructionBenchmark::ResultAggregationModeE ResultAggMode;
  28. };
  29. } // namespace exegesis
  30. } // namespace llvm
  31. #endif // LLVM_TOOLS_LLVM_EXEGESIS_LATENCY_H