10#ifndef LLVM_ANALYSIS_MLMODELRUNNER_H
11#define LLVM_ANALYSIS_MLMODELRUNNER_H
38 return reinterpret_cast<T *
>(
42 template <
typename T,
typename I>
const T *
getTensor(
I FeatureID)
const {
43 return reinterpret_cast<const T *
>(
66 OwnedBuffers.emplace_back(
Spec.getTotalTensorBufferSize());
67 Buffer = OwnedBuffers.back().data();
69 InputBuffers[
Index] = Buffer;
76 std::vector<void *> InputBuffers;
77 std::vector<std::vector<char *>> OwnedBuffers;
This header defines various interfaces for pass management in LLVM.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This is an important class for using LLVM in a threaded context.
MLModelRunner interface: abstraction of a mechanism for evaluating a ML model.
const T * getTensor(I FeatureID) const
virtual void * evaluateUntyped()=0
virtual void switchContext(StringRef Name)
void * getTensorUntyped(size_t Index)
T * getTensor(I FeatureID)
void setUpBufferForTensor(size_t Index, const TensorSpec &Spec, void *Buffer)
const void * getTensorUntyped(size_t Index) const
virtual ~MLModelRunner()=default
MLModelRunner(LLVMContext &Ctx, Kind Type, size_t NumInputs)
MLModelRunner(const MLModelRunner &)=delete
MLModelRunner & operator=(const MLModelRunner &)=delete
StringRef - Represent a constant reference to a string, i.e.
The instances of the Type class are immutable: once they are created, they are never changed.
This is an optimization pass for GlobalISel generic memory operations.