Send feedback
Stay organized with collections
Save and categorize content based on your preferences.
litert::
EnvironmentOptions
#include <litert_environment_options.h>
Manages configuration options for a LiteRT Environment
.
Summary
This class provides methods to access various options related to the LiteRT environment, such as compiler settings, dispatch libraries, and hardware acceleration configurations (e.g., OpenCL, EGL, WebGPU, Metal, Vulkan).
Constructors and Destructors
Tag
{ kCompilerPluginLibraryDir
= kLiteRtEnvOptionTagCompilerPluginLibraryDir, kDispatchLibraryDir
= kLiteRtEnvOptionTagDispatchLibraryDir, kOpenClDeviceId
= kLiteRtEnvOptionTagOpenClDeviceId, kOpenClPlatformId
= kLiteRtEnvOptionTagOpenClPlatformId, kOpenClContext
= kLiteRtEnvOptionTagOpenClContext, kOpenClCommandQueue
= kLiteRtEnvOptionTagOpenClCommandQueue, kEglDisplay
= kLiteRtEnvOptionTagEglDisplay, kEglContext
= kLiteRtEnvOptionTagEglContext, kWebGpuDevice
= kLiteRtEnvOptionTagWebGpuDevice, kWebGpuQueue
= kLiteRtEnvOptionTagWebGpuQueue, kMetalDevice
= kLiteRtEnvOptionTagMetalDevice, kMetalCommandQueue
= kLiteRtEnvOptionTagMetalCommandQueue, kVulkanEnvironment
= kLiteRtEnvOptionTagVulkanEnvironment, kCallbackOnGpuEnvDestroy
= kLiteRtEnvOptionTagCallbackOnGpuEnvDestroy, kCallbackUserDataOnGpuEnvDestroy
=
kLiteRtEnvOptionTagCallbackUserDataOnGpuEnvDestroy, kMagicNumberConfigs
= kLiteRtEnvOptionTagMagicNumberConfigs, kMagicNumberVerifications
= kLiteRtEnvOptionTagMagicNumberVerifications, kCompilerCacheDir
= kLiteRtEnvOptionTagCompilerCacheDir, kWebGpuInstance
= kLiteRtEnvOptionTagWebGpuInstance, kWebGpuProcs
= kLiteRtEnvOptionTagWebGpuProcs, kRuntimeLibraryDir
= kLiteRtEnvOptionTagRuntimeLibraryDir, kSystemRuntimeHandle
= kLiteRtEnvOptionTagSystemRuntimeHandle, kAutoRegisterAccelerators
= kLiteRtEnvOptionTagAutoRegisterAccelerators, kMinLoggerSeverity
= kLiteRtEnvOptionTagMinLoggerSeverity }
enum Tags for environment options.
Retrieves the value of an option specified by a tag.
Public types
Tag
Tag
Tags for environment options.
These tags are used to identify and retrieve specific configuration settings.
kAutoRegisterAccelerators
Bitmask of LiteRtHwAccelerators to auto-register during environment creation.
If unset, LiteRT auto-registers all supported accelerators.
Callback to be invoked on GPU environment destruction.
kCallbackUserDataOnGpuEnvDestroy
User data for the GPU environment destruction callback.
Directory for the compiler cache.
kCompilerPluginLibraryDir
Directory for compiler plugin libraries.
Directory for dispatch libraries.
Magic number configurations.
kMagicNumberVerifications
Magic number verifications.
Minimum logger severity for the environment.
Directory for the runtime library.
\internal This is for internal use only.
Vulkan environment (experimental).
Singleton ML Drift WebGPU/Dawn instance.
Required for shared libraries to prevent them from creating their own instances.
Dawn procedure table pointer.
This allows shared libraries to use the shared procedures instead of their own.
Public functions
EnvironmentOptions
EnvironmentOptions
(
absl
::
Span
<
const
Option
>
options
)
Constructs an EnvironmentOptions
object from a span of options.
Parameters
options
A span of Option
objects to initialize the environment options with.
GetOption
Expected
<
const
LiteRtVariant
>
GetOption
(
Tag
tag
)
const
Retrieves the value of an option specified by a tag.
Parameters
tag
The tag of the option to retrieve.
Returns
An Expected
object containing the option value if successful, or an error if the option is not found or the handle is null.
GetOption
Expected
<
const
LiteRtVariant
>
GetOption
(
LiteRtEnvOptionTag
tag
)
const
GetOptions
absl
::
Span
<
const
Option
>
GetOptions
()
const
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-05-28 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-05-28 UTC."],[],[]]