1*4d7e907cSAndroid Build Coastguard Worker/* 2*4d7e907cSAndroid Build Coastguard Worker * Copyright (C) 2019 The Android Open Source Project 3*4d7e907cSAndroid Build Coastguard Worker * 4*4d7e907cSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*4d7e907cSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*4d7e907cSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*4d7e907cSAndroid Build Coastguard Worker * 8*4d7e907cSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*4d7e907cSAndroid Build Coastguard Worker * 10*4d7e907cSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*4d7e907cSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*4d7e907cSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*4d7e907cSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*4d7e907cSAndroid Build Coastguard Worker * limitations under the License. 15*4d7e907cSAndroid Build Coastguard Worker */ 16*4d7e907cSAndroid Build Coastguard Worker 17*4d7e907cSAndroid Build Coastguard Workerpackage [email protected]; 18*4d7e907cSAndroid Build Coastguard Worker 19*4d7e907cSAndroid Build Coastguard Workerimport @1.2::IExecutionCallback; 20*4d7e907cSAndroid Build Coastguard Workerimport @1.2::OutputShape; 21*4d7e907cSAndroid Build Coastguard Workerimport @1.2::Timing; 22*4d7e907cSAndroid Build Coastguard Worker 23*4d7e907cSAndroid Build Coastguard Worker/** 24*4d7e907cSAndroid Build Coastguard Worker * IExecutionCallback must be used to return the error status result from an 25*4d7e907cSAndroid Build Coastguard Worker * execution asynchronously launched from IPreparedModel::execute*. 26*4d7e907cSAndroid Build Coastguard Worker */ 27*4d7e907cSAndroid Build Coastguard Workerinterface IExecutionCallback extends @1.2::IExecutionCallback { 28*4d7e907cSAndroid Build Coastguard Worker 29*4d7e907cSAndroid Build Coastguard Worker /** 30*4d7e907cSAndroid Build Coastguard Worker * There are three notify methods declared for the IExecutionCallback 31*4d7e907cSAndroid Build Coastguard Worker * interface: notify_1_3, notify_1_2, and notify. One of the three notify 32*4d7e907cSAndroid Build Coastguard Worker * methods must be invoked immediately after the asynchronous task has 33*4d7e907cSAndroid Build Coastguard Worker * finished performing the execution. One of the notify methods must be 34*4d7e907cSAndroid Build Coastguard Worker * provided with the ErrorStatus from the execution. If the asynchronous 35*4d7e907cSAndroid Build Coastguard Worker * task is not launched, one of the notify methods must be invoked with the 36*4d7e907cSAndroid Build Coastguard Worker * appropriate error. 37*4d7e907cSAndroid Build Coastguard Worker * 38*4d7e907cSAndroid Build Coastguard Worker * @param status Error status returned from launching the asynchronous task 39*4d7e907cSAndroid Build Coastguard Worker * (if the launch fails) or from the asynchronous task itself 40*4d7e907cSAndroid Build Coastguard Worker * (if the launch succeeds). Must be: 41*4d7e907cSAndroid Build Coastguard Worker * - NONE if the asynchronous execution was successful 42*4d7e907cSAndroid Build Coastguard Worker * - DEVICE_UNAVAILABLE if driver is offline or busy 43*4d7e907cSAndroid Build Coastguard Worker * - GENERAL_FAILURE if the asynchronous task resulted in an 44*4d7e907cSAndroid Build Coastguard Worker * unspecified error 45*4d7e907cSAndroid Build Coastguard Worker * - OUTPUT_INSUFFICIENT_SIZE if at least one output 46*4d7e907cSAndroid Build Coastguard Worker * operand buffer is not large enough to store the 47*4d7e907cSAndroid Build Coastguard Worker * corresponding output 48*4d7e907cSAndroid Build Coastguard Worker * - INVALID_ARGUMENT if one of the input arguments to 49*4d7e907cSAndroid Build Coastguard Worker * prepareModel is invalid 50*4d7e907cSAndroid Build Coastguard Worker * - MISSED_DEADLINE_* if the execution is aborted because it 51*4d7e907cSAndroid Build Coastguard Worker * cannot be completed by the deadline 52*4d7e907cSAndroid Build Coastguard Worker * - RESOURCE_EXHAUSTED_* if the task was aborted by the driver 53*4d7e907cSAndroid Build Coastguard Worker * @param outputShapes A list of shape information of model output operands. 54*4d7e907cSAndroid Build Coastguard Worker * The index into "outputShapes" corresponds with to index 55*4d7e907cSAndroid Build Coastguard Worker * of the output operand in the Request outputs vector. 56*4d7e907cSAndroid Build Coastguard Worker * outputShapes must be empty unless the status is either 57*4d7e907cSAndroid Build Coastguard Worker * NONE or OUTPUT_INSUFFICIENT_SIZE. 58*4d7e907cSAndroid Build Coastguard Worker * @param timing Duration of execution. Unless MeasureTiming::YES was passed when 59*4d7e907cSAndroid Build Coastguard Worker * launching the execution and status is NONE, all times must 60*4d7e907cSAndroid Build Coastguard Worker * be reported as UINT64_MAX. A driver may choose to report 61*4d7e907cSAndroid Build Coastguard Worker * any time as UINT64_MAX, indicating that particular measurement is 62*4d7e907cSAndroid Build Coastguard Worker * not available. 63*4d7e907cSAndroid Build Coastguard Worker */ 64*4d7e907cSAndroid Build Coastguard Worker oneway notify_1_3(ErrorStatus status, vec<OutputShape> outputShapes, Timing timing); 65*4d7e907cSAndroid Build Coastguard Worker}; 66