Environment probing interface. Returns a list of supported inference backends on the current hardware platform. Recommended to call before configuring the Engine to decide the optimal execution strategy.
This interface is a pure static probing function that can be called without creating an engine, providing a basis for subsequent LiteRtLm_Config decisions.
const char* LiteRtLm_GetAvailableBackends();
| Return Type | Memory Contract & Semantics |
|---|---|
const char* |
Static String. Points to constant memory within the DLL; do not call free(). Returns comma-separated identifiers (e.g., "cpu,gpu"). |
const char* Backends = LiteRtLm_GetAvailableBackends();
FString Supported(Backends);
LiteRtLm_Config config = {0};
if (Supported.Contains("gpu")) {
config.backend = "gpu"; // Found GPU acceleration support
} else {
config.backend = "cpu"; // Fallback to CPU
}