-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add APIs OrtApi::CreateEnvWithOptions() and OrtEpApi::GetEnvConfigEntries()
#26971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
1c4716b
Add APIs: OrtApi::CreateEnvWithConfig() and OrtEpApi::GetEnvConfigEnt…
adrianlizarraga 5b0dc84
Fix orttraining use of renamed function to get or create env
adrianlizarraga 16e7044
Remove OrtEpFactory::SetEnvironmentOptions
adrianlizarraga 4147e65
Update key for allowing virtual devices. Update API name
adrianlizarraga aaa52ad
Update outdated API names in comment
adrianlizarraga fefa722
Move util to common header
adrianlizarraga f56ea6a
Add more env creation tests
adrianlizarraga f99bb9e
Review comments about not initializing version to ORT_API_VERSION
adrianlizarraga c904ab9
fix lambda capture warning-as-error on linux
adrianlizarraga 1000789
Remove ifdef
adrianlizarraga 09ce8c4
Update old API name in a comment
adrianlizarraga 0a2510d
Ok... fix lambda capture warning-as-error take 2
adrianlizarraga 1166494
Add mutex for env config entries map. Update doc comment regarding en…
adrianlizarraga e1a4694
Return managed OrtEnvPtr consistently from OrtEnv:: static functions
adrianlizarraga 5bf1f97
Change config entry 'allow_virtual_devices' to not be ep-specific
adrianlizarraga 1fed4fd
Update doc for GetEnvConfigEntries() that more explicitly states this…
adrianlizarraga 289b40a
Use 'ep_factory.' prefix for env-level ep options
adrianlizarraga 34e75cf
Update doc for env-level ep factory options
adrianlizarraga fc718fd
Address review comments: Add C++ API for GetEnvConfigEntries, use std…
adrianlizarraga 19db309
Merge branch 'main' into adrianl/GetEnvWithOptions
adrianlizarraga d5247e1
Review comment about removal of entry in some cases
adrianlizarraga a085ea9
Merge branch 'main' into adrianl/GetEnvWithOptions
adrianlizarraga 2839c10
Merge branch 'main' into adrianl/GetEnvWithOptions
adrianlizarraga fe906d5
Re-add doc comment end marker
adrianlizarraga File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
include/onnxruntime/core/session/onnxruntime_env_config_keys.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| #pragma once | ||
|
|
||
| // This file contains well-known keys for OrtEnv configuration entries, which may be used to configure EPs or | ||
| // other global settings. | ||
| // Refer to OrtEnvCreationOptions::config_entries and OrtApi::CreateEnvWithOptions. | ||
| // This file does NOT specify all available keys as EPs may accept custom entries with the prefix "ep.<ep_name>.". | ||
|
|
||
| // Key for a boolean option that, when enabled, allows EP factories to create virtual OrtHardwareDevice | ||
| // instances via OrtEpApi::CreateHardwareDevice(). | ||
| // | ||
| // This config entry is automatically set to "1" by ORT if an application registers an EP library with a registration | ||
| // name that ends in the suffix ".virtual". See OrtApi::RegisterExecutionProviderLibrary(). | ||
| // | ||
| // Note: A virtual OrtHardwareDevice does not represent actual hardware on the device, and is identified via the | ||
| // metadata entry "is_virtual" with a value of "1". | ||
| // | ||
| // Allowed values: | ||
| // - "0": Default. Creation of virtual devices is not allowed. | ||
| // This is the assumed default value if this key is not present in the environment's configuration entries. | ||
| // - "1": Creation of virtual devices is allowed. | ||
| static const char* const kOrtEnvAllowVirtualDevices = "allow_virtual_devices"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.