core/litert/litert_bindings library
Classes
- AlignedAlloc
-
Pair of
(raw, aligned)pointers returned by allocAligned. - LiteRtBindings
- Minimal C-API surface for running an embedding forward pass.
- LiteRtLayoutMsvc
- LiteRtLayout as packed by MSVC. Used on Windows only.
- LiteRtLayoutPosix
- LiteRtLayout as packed by GCC/Clang. Used on every platform except Windows. Read LiteRtLayoutView for layout-agnostic accessors.
- LiteRtLayoutView
-
Layout-agnostic view over a
LiteRtLayout*returned from the C API. Pick the right struct (POSIX vs MSVC) based on the host compiler ABI at allocation time so callers don't need to think about it. - LiteRtRankedTensorTypeMsvc
- LiteRtRankedTensorTypePosix
- LiteRtRankedTensorTypeView
-
Layout-agnostic builder for
LiteRtRankedTensorType*. Use this to fill in element type, rank, and dimensions without caring which compiler produced the LiteRT shared library.
Extensions
- LiteRtStatusX on int
- Throws if a LiteRT C call returned a non-OK status code.
Constants
- kLiteRtElementTypeFloat32 → const int
-
LiteRtElementTypevalues used for embedding pipelines. - kLiteRtElementTypeInt32 → const int
- kLiteRtHostMemoryAlignment → const int
-
Host memory alignment required by
LiteRtCreateTensorBufferFromHostMemory(seeLITERT_HOST_MEMORY_BUFFER_ALIGNMENTin litert_tensor_buffer_types.h). - kLiteRtHwAcceleratorCpu → const int
- kLiteRtHwAcceleratorGpu → const int
- kLiteRtHwAcceleratorNone → const int
-
LiteRtHwAcceleratorSetbit flags (litert_common.h). CPU is enough for embedding; GPU/NPU can be wired later. - kLiteRtHwAcceleratorNpu → const int
- kLiteRtMaxRank → const int
- kLiteRtStatusOk → const int
- kLiteRtTensorBufferLockModeRead → const int
-
LiteRtTensorBufferLockModevalues (litert_common.h). - kLiteRtTensorBufferLockModeReadWrite → const int
- kLiteRtTensorBufferLockModeWrite → const int
Functions
-
allocAligned(
int bytes, {int align = kLiteRtHostMemoryAlignment}) → AlignedAlloc -
Allocate
bytesof host memory and return a AlignedAlloc whose.alignedpointer is aligned toalignbytes (default 64, theLITERT_HOST_MEMORY_BUFFER_ALIGNMENTvalue).
Typedefs
-
LiteRtCompiledModel
= Pointer<
_Opaque> -
LiteRtEnvironment
= Pointer<
_Opaque> -
LiteRtModel
= Pointer<
_Opaque> -
LiteRtOptions
= Pointer<
_Opaque> -
LiteRtTensorBuffer
= Pointer<
_Opaque> -
LiteRtTensorBufferRequirements
= Pointer<
_Opaque>