CompatibilityList

public class CompatibilityList

GPU Delegate CompatibilityListing data.

The GPU delegate is not supported on all Android devices, due to differences in available OpenGL versions, driver features, and device resources. This class provides information on whether the GPU delegate is suitable for the current device.

This API is experimental and subject to change.

WARNING: the compatibilityList is constructed from testing done on a limited set of models. You should plan to verify that your own model(s) work.

Example usage:

Interpreter.Options options = new Interpreter.Options();
 try (CompatibilityList compatibilityList = new CompatibilityList()) {
   if (compatibilityList.isDelegateSupportedOnThisDevice()) {
     GpuDelegate.Options delegateOptions = compatibilityList.getBestOptionsForThisDevice();
     gpuDelegate = new GpuDelegate(delegateOptions):
     options.addDelegate(gpuDelegate);
   }
 }
 Interpreter interpreter = new Interpreter(modelBuffer, options);
 

Public Constructors

Public Methods

void
close()
Frees TFLite resources in C runtime.
GpuDelegate.Options
getBestOptionsForThisDevice()
What options should be used for the GPU delegate.
boolean
isDelegateSupportedOnThisDevice()
Whether the GPU delegate is supported on this device.

Inherited Methods

Public Constructors

public CompatibilityList ()

Public Methods

public void close ()

Frees TFLite resources in C runtime.

User is expected to call this method explicitly.

public GpuDelegate.Options getBestOptionsForThisDevice ()

What options should be used for the GPU delegate.

public boolean isDelegateSupportedOnThisDevice ()

Whether the GPU delegate is supported on this device.