xref: /freebsd-src/contrib/llvm-project/llvm/lib/Analysis/NoInferenceModelRunner.cpp (revision 81ad626541db97eb356e2c1d4a20eb2a26a766ab)
10eae32dcSDimitry Andric //===- NoInferenceModelRunner.cpp - noop ML model runner   ----------------===//
20eae32dcSDimitry Andric //
30eae32dcSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40eae32dcSDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50eae32dcSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60eae32dcSDimitry Andric //
70eae32dcSDimitry Andric //===----------------------------------------------------------------------===//
80eae32dcSDimitry Andric //
90eae32dcSDimitry Andric // A pseudo model runner. We use it to store feature values when collecting
100eae32dcSDimitry Andric // logs for the default policy, in 'development' mode, but never ask it to
110eae32dcSDimitry Andric // 'run'.
120eae32dcSDimitry Andric //===----------------------------------------------------------------------===//
130eae32dcSDimitry Andric #include "llvm/Analysis/NoInferenceModelRunner.h"
140eae32dcSDimitry Andric 
150eae32dcSDimitry Andric using namespace llvm;
160eae32dcSDimitry Andric 
NoInferenceModelRunner(LLVMContext & Ctx,const std::vector<TensorSpec> & Inputs)170eae32dcSDimitry Andric NoInferenceModelRunner::NoInferenceModelRunner(
180eae32dcSDimitry Andric     LLVMContext &Ctx, const std::vector<TensorSpec> &Inputs)
19*81ad6265SDimitry Andric     : MLModelRunner(Ctx, MLModelRunner::Kind::NoOp, Inputs.size()) {
20*81ad6265SDimitry Andric   size_t Index = 0;
210eae32dcSDimitry Andric   for (const auto &TS : Inputs)
22*81ad6265SDimitry Andric     setUpBufferForTensor(Index++, TS, nullptr);
230eae32dcSDimitry Andric }
24