litert:: Environment
#include <litert_environment.h>
The environment works like a context that holds the runtime states.
Summary
To create a CompiledModel or TensorBuffer, an Environment is required. In a case of having multiple CompiledModels, it is recommended to share the same Environment.
Public functions |
|
|---|---|
Get() const noexcept
|
LiteRtEnvironment
|
GetHolder() const noexcept
|
|
GetOptions() const
|
|
Release() noexcept
|
|
SupportsAhwbClInterop() const
|
bool
Returns whether the environment supports AHWB/CL interop.
|
SupportsAhwbGlInterop() const
|
bool
Returns whether the environment supports AHWB/GL interop.
|
SupportsClGlInterop() const
|
bool
Returns whether the environment supports CL/GL interop.
|
deprecated("Use EnvironmentOptions::Tag instead.")]] OptionTag
|
enum
|
deprecated("Use EnvironmentOptions::Option instead.")]] Option
|
struct
|
operator bool() const noexcept
|
Returns
true if the underlying LiteRT handle is valid. |
operator!=(const Environment & other) const noexcept
|
bool
|
operator==(const Environment & other) const noexcept
|
bool
|
Public static functions |
|
|---|---|
Create(absl::Span< const Option > options)
|
|
Create(const EnvironmentOptions & options)
|
|
WrapCObject(LiteRtEnvironment env, OwnHandle owned)
|
|
WrapCObject(const internal::EnvironmentHolder & env, OwnHandle owned)
|
|
Public functions
Get
LiteRtEnvironment Get() const noexcept
GetHolder
internal::EnvironmentHolder GetHolder() const noexcept
GetOptions
Expected< EnvironmentOptions > GetOptions() const
Release
internal::EnvironmentHolder Release() noexcept
SupportsAhwbClInterop
bool SupportsAhwbClInterop() const
Returns whether the environment supports AHWB/CL interop.
SupportsAhwbGlInterop
bool SupportsAhwbGlInterop() const
Returns whether the environment supports AHWB/GL interop.
SupportsClGlInterop
bool SupportsClGlInterop() const
Returns whether the environment supports CL/GL interop.
deprecated
enum deprecated( "Use EnvironmentOptions::Tag instead." )]] OptionTag
deprecated
struct deprecated( "Use EnvironmentOptions::Option instead." )]] Option
operator bool
operator bool() const noexcept
Returns true if the underlying LiteRT handle is valid.
operator!=
bool operator!=( const Environment & other ) const noexcept
operator==
bool operator==( const Environment & other ) const noexcept
Public static functions
Create
Expected< Environment > Create( absl::Span< const Option > options )
Create
Expected< Environment > Create( const EnvironmentOptions & options )
WrapCObject
Environment WrapCObject( LiteRtEnvironment env, OwnHandle owned )
WrapCObject
Environment WrapCObject( const internal::EnvironmentHolder & env, OwnHandle owned )