pub unsafe extern "C" fn ANeuralNetworksCompilation_createForDevices(
model: *mut ANeuralNetworksModel,
devices: *const *const ANeuralNetworksDevice,
numDevices: u32,
compilation: *mut *mut ANeuralNetworksCompilation,
) -> c_intExpand description
Create a {@link ANeuralNetworksCompilation} to compile the given model for a specified set of devices. If more than one device is specified, the compilation will distribute the workload automatically across the devices. The model must be fully supported by the specified set of devices. This means that ANeuralNetworksModel_getSupportedOperationsForDevices() must have returned true for every operation for that model/devices pair.
The user must handle all compilation and execution failures from the specified set of devices. This is in contrast to a use of {@link ANeuralNetworksCompilation_create}, where the runtime will attempt to recover from such failures.
The model passed to this function is termed the “main model” of the compilation, to distinguish it from other models referred to by an Operand of type {@link ANEURALNETWORKS_MODEL} within this compilation.
@param model The {@link ANeuralNetworksModel} to be compiled. @param devices The set of devices. Must not contain duplicates. @param numDevices The number of devices in the set. @param compilation The newly created object or NULL if unsuccessful.
@return ANEURALNETWORKS_NO_ERROR if successful, ANEURALNETWORKS_BAD_DATA if the model is invalid.
Available since API level 29.