LLVM  14.0.0git
MLModelRunner.h
Go to the documentation of this file.
1 //===- MLModelRunner.h ---- ML model runner interface -----------*- 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 
10 #ifndef LLVM_ANALYSIS_MLMODELRUNNER_H
11 #define LLVM_ANALYSIS_MLMODELRUNNER_H
12 
14 #include "llvm/IR/LLVMContext.h"
15 #include "llvm/IR/PassManager.h"
16 
17 namespace llvm {
18 
19 /// MLModelRunner interface: abstraction of a mechanism for evaluating a
20 /// tensorflow "saved model".
22 public:
23  // Disallows copy and assign.
24  MLModelRunner(const MLModelRunner &) = delete;
25  MLModelRunner &operator=(const MLModelRunner &) = delete;
26  virtual ~MLModelRunner() = default;
27 
28  virtual bool run() = 0;
29  virtual void setFeature(FeatureIndex Index, int64_t Value) = 0;
30  virtual int64_t getFeature(int Index) const = 0;
31 
32 protected:
34 
36 };
37 } // namespace llvm
38 
39 #endif // LLVM_ANALYSIS_MLMODELRUNNER_H
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::MLModelRunner::setFeature
virtual void setFeature(FeatureIndex Index, int64_t Value)=0
llvm::MLModelRunner::~MLModelRunner
virtual ~MLModelRunner()=default
llvm::MLModelRunner::MLModelRunner
MLModelRunner(const MLModelRunner &)=delete
llvm::MLModelRunner::MLModelRunner
MLModelRunner(LLVMContext &Ctx)
Definition: MLModelRunner.h:33
Index
uint32_t Index
Definition: ELFObjHandler.cpp:84
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
llvm::FeatureIndex
FeatureIndex
Definition: InlineModelFeatureMaps.h:107
llvm::MLModelRunner::run
virtual bool run()=0
llvm::MLModelRunner::operator=
MLModelRunner & operator=(const MLModelRunner &)=delete
llvm::MLModelRunner::Ctx
LLVMContext & Ctx
Definition: MLModelRunner.h:35
PassManager.h
InlineModelFeatureMaps.h
LLVMContext.h
llvm::MLModelRunner::getFeature
virtual int64_t getFeature(int Index) const =0
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
llvm::MLModelRunner
MLModelRunner interface: abstraction of a mechanism for evaluating a tensorflow "saved model".
Definition: MLModelRunner.h:21