ANeuralNetworksExecution_compute

Function ANeuralNetworksExecution_compute 

Source
pub unsafe extern "C" fn ANeuralNetworksExecution_compute(
    execution: *mut ANeuralNetworksExecution,
) -> c_int
Expand description

Schedule synchronous evaluation of the execution.

Schedules synchronous evaluation of the execution. Returns once the execution has completed and the outputs are ready to be consumed.

If {@link ANeuralNetworksExecution_setTimeout} was called on this execution, and the execution is not able to complete before the timeout duration is exceeded, then execution may be aborted, in which case {@link ANEURALNETWORKS_MISSED_DEADLINE_*} will be returned. If the device has a feature level reported by {@link ANeuralNetworksDevice_getFeatureLevel} that is lower than 30, then the timeout duration hint will be ignored.

If this execution contains a {@link ANEURALNETWORKS_WHILE} operation, and the condition model does not output false within the loop timeout duration, then execution will be aborted and {@link ANEURALNETWORKS_MISSED_DEADLINE_*} will be returned.

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

See {@link ANeuralNetworksExecution_burstCompute} for burst synchronous execution. See {@link ANeuralNetworksExecution_startCompute} for regular asynchronous execution. See {@link ANeuralNetworksExecution_startComputeWithDependencies} for asynchronous execution with dependencies.

Available since API level 29.

@param execution The execution to be scheduled and executed.

@return ANEURALNETWORKS_NO_ERROR if the execution completed normally. ANEURALNETWORKS_UNMAPPABLE if the execution input or output memory cannot be properly mapped.