ANeuralNetworksExecution_startCompute

Function ANeuralNetworksExecution_startCompute 

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

Schedule asynchronous evaluation of the execution.

Schedules asynchronous evaluation of the execution. Once the execution has completed and the outputs are ready to be consumed, the returned event will be signaled. Use {@link ANeuralNetworksEvent_wait} to wait for that event.

ANeuralNetworksEvent_wait must be called to recuperate the resources used by the execution.

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 through {@link ANeuralNetworksExecution_startCompute} or {@link ANeuralNetworksEvent_wait} on the event object. 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 through {@link ANeuralNetworksEvent_wait} on the event object.

If the device can detect before the execution has started that the execution will not complete within the timeout duration, the device may choose to skip the execution and instead return {@link ANEURALNETWORKS_MISSED_DEADLINE_*}.

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

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

Available since API level 27.

@param execution The execution to be scheduled and executed. @param event The event that will be signaled on completion. event is set to NULL if there’s an error.

@return ANEURALNETWORKS_NO_ERROR if the evaluation is successfully scheduled.