blob: 39076b9a16b5e5eb46f9376cc9191ef82241ef7f [file] [log] [blame]
/*
* Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.hardware.neuralnetworks@1.3;
import @1.2::Timing;
import ErrorStatus;
/**
* IFencedExecutionCallback can be used to query the error status result
* and duration information from an IPreparedModel::executeFenced call.
*/
interface IFencedExecutionCallback {
/**
* The getExecutionInfo method is used by the clients to query error status
* result and duration information. The method must only be called after the actual
* evaluation has finished or resulted in an runtime error, as indicated by the status
* of the sync fence returned by the IPreparedModel::executeFenced call, otherwise
* GENERAL_FAILURE must be returned.
*
* @return status Error status returned from the asynchronously dispatched execution
* must be:
* - NONE if the asynchronous execution was successful
* - DEVICE_UNAVAILABLE if driver is offline or busy
* - GENERAL_FAILURE if the asynchronous task resulted in an
* unspecified error
* @return timing Duration of execution. Unless MeasureTiming::YES was passed when
* launching the execution and status is NONE, all times must
* be reported as UINT64_MAX. A driver may choose to report
* any time as UINT64_MAX, indicating that particular measurement is
* not available.
*/
getExecutionInfo() generates (ErrorStatus status, Timing timing);
};