Xusong Wang | b5cb8f7 | 2018-10-31 08:43:12 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 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.2; |
| 18 | |
| 19 | import @1.0::ErrorStatus; |
| 20 | import @1.0::IExecutionCallback; |
Xusong Wang | 187c597 | 2018-11-07 09:33:59 -0800 | [diff] [blame] | 21 | import OutputShape; |
Xusong Wang | b5cb8f7 | 2018-10-31 08:43:12 -0700 | [diff] [blame] | 22 | |
| 23 | /** |
| 24 | * IExecutionCallback must be used to return the error status result from an |
| 25 | * execution asynchronously launched from IPreparedModel::execute. |
| 26 | */ |
| 27 | interface IExecutionCallback extends @1.0::IExecutionCallback { |
| 28 | |
| 29 | /** |
| 30 | * Either notify_1_2 or notify must be invoked immediately after the asynchronous |
| 31 | * task has finished performing the execution. Either notify_1_2 or notify must be |
| 32 | * provided with the ErrorStatus from the execution. If the asynchronous task is |
| 33 | * not launched, either notify_1_2 or notify must be invoked with the appropriate |
| 34 | * error. |
| 35 | * |
| 36 | * @param status Error status returned from launching the asynchronous task |
| 37 | * (if the launch fails) or from the asynchronous task itself |
| 38 | * (if the launch succeeds). Must be: |
| 39 | * - NONE if the asynchronous execution was successful |
| 40 | * - DEVICE_UNAVAILABLE if driver is offline or busy |
| 41 | * - GENERAL_FAILURE if the asynchronous task resulted in an |
| 42 | * unspecified error |
Xusong Wang | 187c597 | 2018-11-07 09:33:59 -0800 | [diff] [blame] | 43 | * - OUTPUT_INSUFFICIENT_SIZE if at least one output |
| 44 | * operand buffer is not large enough to store the |
| 45 | * corresponding output |
Xusong Wang | b5cb8f7 | 2018-10-31 08:43:12 -0700 | [diff] [blame] | 46 | * - INVALID_ARGUMENT if one of the input arguments to |
| 47 | * prepareModel is invalid |
Xusong Wang | 187c597 | 2018-11-07 09:33:59 -0800 | [diff] [blame] | 48 | * @param outputShapes A list of shape information of model output operands. |
| 49 | * The index into "outputShapes" corresponds with to index |
| 50 | * of the output operand in the Request outputs vector. |
| 51 | * outputShapes must be empty unless the status is either |
| 52 | * NONE or OUTPUT_INSUFFICIENT_SIZE. |
Xusong Wang | b5cb8f7 | 2018-10-31 08:43:12 -0700 | [diff] [blame] | 53 | */ |
Xusong Wang | 187c597 | 2018-11-07 09:33:59 -0800 | [diff] [blame] | 54 | oneway notify_1_2(ErrorStatus status, vec<OutputShape> outputShapes); |
Xusong Wang | b5cb8f7 | 2018-10-31 08:43:12 -0700 | [diff] [blame] | 55 | }; |