blob: 47de1b60ec70903e82d319ec6c612bd3d90d4ed7 [file] [log] [blame]
Xusong Wangb5cb8f72018-10-31 08:43:12 -07001/*
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
17package android.hardware.neuralnetworks@1.2;
18
19import @1.0::ErrorStatus;
20import @1.0::IExecutionCallback;
Xusong Wang187c5972018-11-07 09:33:59 -080021import OutputShape;
Xusong Wangb5cb8f72018-10-31 08:43:12 -070022
23/**
24 * IExecutionCallback must be used to return the error status result from an
25 * execution asynchronously launched from IPreparedModel::execute.
26 */
27interface 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 Wang187c5972018-11-07 09:33:59 -080043 * - OUTPUT_INSUFFICIENT_SIZE if at least one output
44 * operand buffer is not large enough to store the
45 * corresponding output
Xusong Wangb5cb8f72018-10-31 08:43:12 -070046 * - INVALID_ARGUMENT if one of the input arguments to
47 * prepareModel is invalid
Xusong Wang187c5972018-11-07 09:33:59 -080048 * @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 Wangb5cb8f72018-10-31 08:43:12 -070053 */
Xusong Wang187c5972018-11-07 09:33:59 -080054 oneway notify_1_2(ErrorStatus status, vec<OutputShape> outputShapes);
Xusong Wangb5cb8f72018-10-31 08:43:12 -070055};