Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:15

0001 //===- NoInferenceModelRunner.h ---- noop ML model runner  ------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 
0010 #ifndef LLVM_ANALYSIS_NOINFERENCEMODELRUNNER_H
0011 #define LLVM_ANALYSIS_NOINFERENCEMODELRUNNER_H
0012 
0013 #include "llvm/Analysis/MLModelRunner.h"
0014 namespace llvm {
0015 class TensorSpec;
0016 
0017 /// A pseudo model runner. We use it to store feature values when collecting
0018 /// logs for the default policy, in 'development' mode, but never ask it to
0019 /// 'run'.
0020 class NoInferenceModelRunner : public MLModelRunner {
0021 public:
0022   NoInferenceModelRunner(LLVMContext &Ctx,
0023                          const std::vector<TensorSpec> &Inputs);
0024 
0025   static bool classof(const MLModelRunner *R) {
0026     return R->getKind() == MLModelRunner::Kind::NoOp;
0027   }
0028 
0029 private:
0030   void *evaluateUntyped() override {
0031     llvm_unreachable("We shouldn't call run on this model runner.");
0032   }
0033 };
0034 } // namespace llvm
0035 #endif // LLVM_ANALYSIS_NOINFERENCEMODELRUNNER_H