ANeuralNetworksCompilation_create

Function ANeuralNetworksCompilation_create 

Source
pub unsafe extern "C" fn ANeuralNetworksCompilation_create(
    model: *mut ANeuralNetworksModel,
    compilation: *mut *mut ANeuralNetworksCompilation,
) -> c_int
Expand description

Create a {@link ANeuralNetworksCompilation} to compile the given model.

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.

This function only creates the object. Compilation is only performed once {@link ANeuralNetworksCompilation_finish} is invoked.

{@link ANeuralNetworksCompilation_finish} should be called once all desired properties have been set on the compilation.

{@link ANeuralNetworksModel_free} should be called once the compilation is no longer needed.

The provided model must outlive the compilation.

The model must already have been finished by a call to {@link ANeuralNetworksModel_finish}.

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

Available since API level 27.

@param model The {@link ANeuralNetworksModel} to be compiled. @param compilation The newly created object or NULL if unsuccessful.

@return ANEURALNETWORKS_NO_ERROR if successful, ANEURALNETWORKS_BAD_DATA if the model is invalid.