NoInferenceModelRunner.cpp 968 B

1234567891011121314151617181920212223
  1. //===- NoInferenceModelRunner.cpp - noop ML model runner ----------------===//
  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. // A pseudo model runner. We use it to store feature values when collecting
  10. // logs for the default policy, in 'development' mode, but never ask it to
  11. // 'run'.
  12. //===----------------------------------------------------------------------===//
  13. #include "llvm/Analysis/NoInferenceModelRunner.h"
  14. using namespace llvm;
  15. NoInferenceModelRunner::NoInferenceModelRunner(
  16. LLVMContext &Ctx, const std::vector<TensorSpec> &Inputs)
  17. : MLModelRunner(Ctx, MLModelRunner::Kind::NoOp, Inputs.size()) {
  18. size_t Index = 0;
  19. for (const auto &TS : Inputs)
  20. setUpBufferForTensor(Index++, TS, nullptr);
  21. }