HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
run_options.h
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License.
3 
4 #pragma once
5 
6 #include <string>
7 #include <atomic>
8 
10 #include "core/session/onnxruntime_c_api.h"
11 #include "core/framework/config_options.h"
12 
13 namespace onnxruntime {
14 namespace lora {
15 class LoraAdapter;
16 }
17 } // namespace onnxruntime
18 
19 /**
20  * Configuration information for a Run call.
21  */
22 struct OrtRunOptions {
23  /// Log severity. See https://github.com/microsoft/onnxruntime/blob/main/include/onnxruntime/core/common/logging/severity.h
24  /// Default = -1 (use the log severity from the InferenceSession that the Run is for).
26  int run_log_verbosity_level = 0; ///< VLOG level if debug build and run_log_severity_level is 0 (VERBOSE).
27  std::string run_tag; ///< A tag for the Run() calls using this.
28 
29  // Set to 'true' to ensure the termination of all the outstanding Run() calls
30  // that use this OrtRunOptions instance. Some of the outstanding Run() calls may
31  // be forced to terminate with an error status.
32  bool terminate = false;
33 
34  // Set to 'true' to run only the nodes from feeds to required fetches.
35  // So it is possible that only some of the nodes are executed.
37 
38 #ifdef ENABLE_TRAINING
39  // Used by onnxruntime::training::TrainingSession. This class is now deprecated.
40  // Delete training_mode when TrainingSession is deleted.
41  // Set to 'true' to run in training mode.
42  bool training_mode = true;
43 #endif
44 
45  // Stores the configurations for this run
46  // To add an configuration to this specific run, call OrtApis::AddRunConfigEntry
47  // The configuration keys and value formats are defined in
48  // /include/onnxruntime/core/session/onnxruntime_run_options_config_keys.h
49  onnxruntime::ConfigOptions config_options;
50 
52 
53  OrtRunOptions() = default;
54  ~OrtRunOptions() = default;
55 };
56 
57 namespace onnxruntime {
59 } // namespace onnxruntime
int run_log_severity_level
Definition: run_options.h:25
int run_log_verbosity_level
VLOG level if debug build and run_log_severity_level is 0 (VERBOSE).
Definition: run_options.h:26
std::string run_tag
A tag for the Run() calls using this.
Definition: run_options.h:27
~OrtRunOptions()=default
::OrtRunOptions RunOptions
absl::InlinedVector< T, N, Allocator > InlinedVector
OrtRunOptions()=default
onnxruntime::InlinedVector< const onnxruntime::lora::LoraAdapter * > active_adapters
Definition: run_options.h:51
bool only_execute_path_to_fetches
Definition: run_options.h:36
onnxruntime::ConfigOptions config_options
Definition: run_options.h:49