blob: a7c33420932c09435e6ab4b5f302d13041fb5e69 [file] [log] [blame]
/*
* Copyright (C) 2017 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.0;
import IEvent;
/**
* IPreparedModel describes a model that has been prepared for execution and
* is used to launch executions.
*/
interface IPreparedModel {
/**
* Spawns an asynchronous execution on a prepared model.
*
* Executions are asynchronous with respect to the Neuralnetworks runtime.
* To support this, IPreparedModel::execute must spawn a new task and return
* whether the task was successfully launched. The asynchronous task which
* performs the execution must call event's IEvent::notify with the status
* of the execution immediately after the execution has finished.
*
* Multiple threads can call this execute function concurrently.
*
* @param request The input and output information on which the prepared
* model is to be executed.
* prepared model.
* @param event A callback used for synchronization that must be signaled
* once the execution has finished.
* @return status ErrorStatus::NONE if the asynchronous task was
* successfully launched.
*/
execute(Request request, IEvent event) generates (ErrorStatus status);
};