Miao Wang | 90cf3dd | 2019-11-12 14:02:16 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2020 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.hardware.neuralnetworks@1.3; |
| 18 | |
| 19 | import @1.2::Timing; |
| 20 | import ErrorStatus; |
| 21 | |
| 22 | /** |
| 23 | * IFencedExecutionCallback can be used to query the error status result |
| 24 | * and duration information from an IPreparedModel::executeFenced call. |
| 25 | */ |
| 26 | interface IFencedExecutionCallback { |
| 27 | |
| 28 | /** |
| 29 | * The getExecutionInfo method is used by the clients to query error status |
| 30 | * result and duration information. The method must only be called after the actual |
| 31 | * evaluation has finished or resulted in an runtime error, as indicated by the status |
| 32 | * of the sync fence returned by the IPreparedModel::executeFenced call, otherwise |
| 33 | * GENERAL_FAILURE must be returned. |
| 34 | * |
| 35 | * @return status Error status returned from the asynchronously dispatched execution |
| 36 | * must be: |
| 37 | * - NONE if the asynchronous execution was successful |
| 38 | * - DEVICE_UNAVAILABLE if driver is offline or busy |
| 39 | * - GENERAL_FAILURE if the asynchronous task resulted in an |
| 40 | * unspecified error |
| 41 | * @return timing Duration of execution. Unless MeasureTiming::YES was passed when |
| 42 | * launching the execution and status is NONE, all times must |
| 43 | * be reported as UINT64_MAX. A driver may choose to report |
| 44 | * any time as UINT64_MAX, indicating that particular measurement is |
| 45 | * not available. |
| 46 | */ |
| 47 | getExecutionInfo() generates (ErrorStatus status, Timing timing); |
| 48 | }; |