blob: ff295a230e5b14d06343c261f762faa792f3dde1 [file] [log] [blame]
Xusong Wang68c32342019-10-23 10:35:07 -07001/*
2 * Copyright (C) 2019 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.3;
18
19import @1.0::ErrorStatus;
20import @1.2::IPreparedModelCallback;
Xusong Wang62a760c2019-10-25 12:07:17 -070021import IPreparedModel;
Xusong Wang68c32342019-10-23 10:35:07 -070022
23/**
24 * IPreparedModelCallback must be used to return a prepared model produced by an
25 * asynchronous task launched from IDevice::prepareModel.
26 */
27interface IPreparedModelCallback extends @1.2::IPreparedModelCallback {
28
29 /**
30 * There are three notify methods declared for the IPreparedModelCallback
31 * interface: notify_1_3, notify_1_2, and notify. One of the three
32 * notify methods must be invoked immediately after the asynchronous
33 * task holding this callback has finished preparing the model. If the model was
34 * successfully prepared, one of the notify methods must be invoked with
35 * ErrorStatus::NONE and the prepared model. If the model was not able to be
36 * successfully prepared, one of the notify methods must be invoked with the
37 * appropriate ErrorStatus and nullptr as the IPreparedModel. If the asynchronous
38 * task holding this callback fails to launch or if the model provided to
39 * IDevice::prepareModel is invalid, one of the notify methods must be invoked
40 * with the appropriate error as well as nullptr for the IPreparedModel.
41 *
42 * @param status Error status returned from the asynchronous model
43 * preparation task; must be:
44 * - NONE if the asynchronous task successfully prepared the
45 * model
46 * - DEVICE_UNAVAILABLE if driver is offline or busy
47 * - GENERAL_FAILURE if the asynchronous task resulted in an
48 * unspecified error
49 * - INVALID_ARGUMENT if one of the input arguments to
50 * prepareModel is invalid
51 * @param preparedModel A model that has been asynchronously prepared for
52 * execution. If the model was unable to be prepared
53 * due to an error, nullptr must be passed in place of
54 * the IPreparedModel object.
55 */
56 oneway notify_1_3(ErrorStatus status, IPreparedModel preparedModel);
57};