1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
10 #include <ie_iinfer_request.hpp>
11 #include "ie_iinfer_request_internal.hpp"
13 namespace InferenceEngine {
16 * @brief minimum API to be implemented by plugin, which is used in InferRequestBase forwarding mechanism
18 class IAsyncInferRequestInternal : virtual public IInferRequestInternal {
20 typedef std::shared_ptr<IAsyncInferRequestInternal> Ptr;
22 virtual ~IAsyncInferRequestInternal() = default;
25 * @brief Start inference of specified input(s) in asynchronous mode
26 * @note: It returns immediately. Inference starts also immediately.
28 virtual void StartAsync() = 0;
31 * @brief Waits for the result to become available. Blocks until specified millis_timeout has elapsed or the result becomes available, whichever comes first.
32 * @param millis_timeout - maximum duration in milliseconds to block for
33 * @note There are special cases when millis_timeout is equal some value of WaitMode enum:
34 * * STATUS_ONLY - immediately returns request status (IInferRequest::RequestStatus). It doesn't block or interrupt current thread.
35 * * RESULT_READY - waits until inference result becomes available
37 virtual StatusCode Wait(int64_t millis_timeout) = 0;
40 * @brief Get arbitrary data for the request
41 * @param data - pointer to a pointer to arbitrary data
43 virtual void GetUserData(void **data) = 0;
46 * @brief Set arbitrary data for the request
47 * @param data - pointer to a pointer to arbitrary data
49 virtual void SetUserData(void *data) = 0;
52 * @brief Set callback function which will be called on success or failure of asynchronous request
53 * @param callback - function to be called with the following description:
54 * * @param context - pointer to request for providing context inside callback
55 * * @param resp - Optional: a pointer to an already allocated object to contain extra information of a failure (if occurred)
56 * * @return Enumeration of the resulted action: OK (0) for success.
58 virtual void SetCompletionCallback(IInferRequest::CompletionCallback callback) = 0;
61 } // namespace InferenceEngine