blob: ef0f4549dd09d53da876257e14a98416d5b29cc5 [file] [log] [blame]
Michael Butlercf22a572017-09-22 13:26:12 -07001/*
2 * Copyright (C) 2017 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.0;
18
19/**
20 * IExecutionCallback must be used to return the error status result from an
21 * execution asynchronously launched from IPreparedModel::execute.
22 */
23interface IExecutionCallback {
24
25 /**
26 * notify must be invoked immediately after the asynchronous task has
27 * finished performing the execution. notify must be provided with the
28 * ErrorStatus resulting from the execution. If the asynchronous task
29 * is not launched, notify must be invoked with the appropriate error.
30 *
31 * @return param Error status returned from launching the asynchronous task
32 * (if the launch fails) or from the asynchronous task itself
33 * (if the launch succeeds). Must be:
34 * - NONE if the asynchronous execution was successful
35 * - DEVICE_UNAVAILABLE if driver is offline or busy
36 * - GENERAL_FAILURE if the asynchronous task resulted in an
37 * unspecified error
38 * - OUTPUT_INSUFFICIENT_SIZE if provided output buffer is
39 * not large enough to store the resultant values
40 * - INVALID_ARGUMENT if one of the input arguments to
41 * prepareModel is invalid
42 */
43 oneway notify(ErrorStatus status);
44};