// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #if !defined(ORT_MINIMAL_BUILD) #include #include #include "core/common/status.h" #include "core/framework/execution_provider.h" #include "core/session/abi_session_options_impl.h" #include "core/session/model_package/model_package_context.h" // VariantSelectionEpInfo #include "core/session/environment.h" namespace onnxruntime { class ModelPackageOptions { public: ModelPackageOptions(const Environment& env, const OrtSessionOptions& session_options); Status RebuildProviderListForSession(const Environment& env, const OrtSessionOptions& effective_options) const; // Resolved state accessors std::vector>& MutableProviderList() const noexcept { return provider_list_; } const std::vector>& ProviderList() const noexcept { return provider_list_; } const std::vector& EpInfos() const noexcept { return ep_infos_; } const std::vector& ExecutionDevices() const noexcept { return execution_devices_; } const std::vector& DevicesSelected() const noexcept { return devices_selected_; } bool FromPolicy() const noexcept { return from_policy_; } private: void ResolveEpSelection(const Environment& env, const OrtSessionOptions& session_options); // might needs to be rebuilt per session creation, as it becomes empty // after consumed by RegisterExecutionProvider(std::move(...)). mutable std::vector> provider_list_{}; std::vector ep_infos_{}; std::vector execution_devices_{}; std::vector devices_selected_{}; bool from_policy_{false}; }; } // namespace onnxruntime #endif // !defined(ORT_MINIMAL_BUILD)