blob: 39076b9a16b5e5eb46f9376cc9191ef82241ef7f [file] [log] [blame]
Miao Wang90cf3dd2019-11-12 14:02:16 -08001/*
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
17package android.hardware.neuralnetworks@1.3;
18
19import @1.2::Timing;
20import ErrorStatus;
21
22/**
23 * IFencedExecutionCallback can be used to query the error status result
24 * and duration information from an IPreparedModel::executeFenced call.
25 */
26interface 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};