ANeuralNetworksCompilation_setPreference

Function ANeuralNetworksCompilation_setPreference 

Source
pub unsafe extern "C" fn ANeuralNetworksCompilation_setPreference(
    compilation: *mut ANeuralNetworksCompilation,
    preference: i32,
) -> c_int
Expand description

Sets the execution preference.

Provides guidance to the runtime when trade-offs are possible. By default the runtime uses PREFER_SINGLE_FAST_ANSWER

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

Available since API level 27.

@param compilation The compilation to be modified. @param preference Either {@link PREFER_LOW_POWER}, {@link PREFER_SINGLE_FAST_ANSWER}, or {@link PREFER_SUSTAINED_SPEED}.

@return ANEURALNETWORKS_NO_ERROR if successful.