getAvailableDevices static method

Future<List<String>> getAvailableDevices()

Lists all available devices that Cheetah can use for inference. Entries in the list can be used as the device argument when initializing Cheetah.

Throws a CheetahException if unable to get devices

returns a list of devices Cheetah can run inference on

Implementation

static Future<List<String>> getAvailableDevices() async {
  try {
    List<String> devices = (await _channel
        .invokeMethod(_NativeFunctions.GET_AVAILABLE_DEVICES.name, {}))
        .cast<String>();
    return devices;
  } on PlatformException catch (error) {
    throw cheetahStatusToException(error.code, error.message);
  } on Exception catch (error) {
    throw cheetahStatusToException("CheetahException", error.toString());
  }
}