BuiltinNpuAcceleratorProvider

class BuiltinNpuAcceleratorProvider : NpuAcceleratorProvider


An implementation of NpuAcceleratorProvider, which provides the NPU libraries without dynamic downloading.

This implementation is for apps with built-in NPU libraries, or with NPU libraries delivered as "install-time" Google Play Feature modules.

Summary

Public constructors

Public functions

open suspend Unit

Downloads the NPU library if needed.

open String

Returns the local directory of the NPU library.

open Boolean

Returns true if the device is compatible with NPU library..

open Boolean

Returns true if the NPU library is ready to use.

Public constructors

BuiltinNpuAcceleratorProvider

@<Error class: unknown class>
BuiltinNpuAcceleratorProvider(
    context: <Error class: unknown class>,
    npuCompatibilityChecker: NpuCompatibilityChecker = DefaultNpuCompatibilityChecker()
)

Public functions

downloadLibrary

open suspend fun downloadLibrary(): Unit

Downloads the NPU library if needed.

getLibraryDir

open fun getLibraryDir(): String

Returns the local directory of the NPU library.

isDeviceSupported

open fun isDeviceSupported(): Boolean

Returns true if the device is compatible with NPU library..

isLibraryReady

open fun isLibraryReady(): Boolean

Returns true if the NPU library is ready to use.