platform_hardware_interfaces/neuralnetworks/1.3/IFencedExecutionCallback.hal
Michael Butler 9b9a804fe4 Relax NNAPI QoS deadline parameter
Prior to this CL, the NNAPI QoS deadline is a strict deadline: a task
with a deadline must either complete or abort by the deadline. To
avoid as much overhead as possible, it is requested for Android R to
have a relaxed deadline, where the task *may* be aborted after the
deadline has passed or when the task is estimated to take too long.

Because the deadline is now relaxed, the querying method
IDevice::supportsDeadlines can be removed.

Bug: 149766387
Test: mma
Test: VtsHalNeuralnetworksV1_3TargetTest
Change-Id: Ib9937b5bb95646c2fd82e1aa17f2b0b639e2c420
2020-02-19 10:07:56 -08:00

61 lines
3.1 KiB
Text

/*
* Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.hardware.neuralnetworks@1.3;
import @1.2::Timing;
import ErrorStatus;
/**
* IFencedExecutionCallback can be used to query the error status result
* and duration information from an IPreparedModel::executeFenced call.
*/
interface IFencedExecutionCallback {
/**
* The getExecutionInfo method is used by the clients to query error status
* result and duration information. The method must only be called after the actual
* evaluation has finished or resulted in an runtime error, as indicated by the status
* of the sync fence returned by the IPreparedModel::executeFenced call, otherwise
* GENERAL_FAILURE must be returned.
*
* @return status Error status returned from the asynchronously dispatched execution
* must be:
* - NONE if the asynchronous execution was successful
* - DEVICE_UNAVAILABLE if driver is offline or busy
* - GENERAL_FAILURE if the asynchronous task resulted in an
* unspecified error
* - MISSED_DEADLINE_* if the execution is aborted because it
* cannot be completed by the deadline
* - RESOURCE_EXHAUSTED_* if the task was aborted by the
* driver
* @return timingLaunched The duration starts when executeFenced is called and ends when
* executeFenced signals the returned syncFence.
* Unless MeasureTiming::YES was passed when
* launching the execution and status is NONE, all times
* must be reported as UINT64_MAX. A driver may choose to
* report any time as UINT64_MAX, indicating that particular
* measurement is not available.
* @return timingFenced The duration starts when all waitFor sync fences have been signaled
* and ends when executeFenced signals the returned syncFence.
* Unless MeasureTiming::YES was passed when
* launching the execution and status is NONE, all times
* must be reported as UINT64_MAX. A driver may choose to
* report any time as UINT64_MAX, indicating that particular
* measurement is not available.
*/
getExecutionInfo() generates (ErrorStatus status, Timing timingLaunched, Timing timingFenced);
};