ANeuralNetworksCompilation_setCaching

Function ANeuralNetworksCompilation_setCaching 

Source
pub unsafe extern "C" fn ANeuralNetworksCompilation_setCaching(
    compilation: *mut ANeuralNetworksCompilation,
    cacheDir: *const c_char,
    token: *const u8,
) -> c_int
Expand description

Sets the compilation caching signature and the cache directory.

Provides optional caching information to the runtime for faster repeated compilation.

See {@link ANeuralNetworksCompilation} for information on multithreaded usage.

@param compilation The compilation to be modified. @param cacheDir The cache directory for the runtime to store and retrieve caching data. It is recommended to use the code cache directory provided by the Android runtime. If not using the code cache directory, the user should choose a directory local to the application, and is responsible for managing the cache entries. @param token The token provided by the user to specify a model must be of length ANEURALNETWORKS_BYTE_SIZE_OF_CACHE_TOKEN. The user should ensure that the token is unique to a model within the application. The NNAPI runtime cannot detect token collisions; a collision will result in a failed execution or in a successful execution that produces incorrect output values.

@return ANEURALNETWORKS_NO_ERROR if successful.

Available since API level 29.