Keith Davis | e813d67 | 2021-04-22 10:10:34 +0100 | [diff] [blame^] | 1 | // |
| 2 | // Copyright © 2021 Arm Ltd and Contributors. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
| 8 | #include "Types.hpp" |
| 9 | |
| 10 | namespace armnn |
| 11 | { |
| 12 | |
| 13 | namespace experimental |
| 14 | { |
| 15 | |
| 16 | class IAsyncExecutionCallback; |
| 17 | using IAsyncExecutionCallbackPtr = std::shared_ptr<IAsyncExecutionCallback>; |
| 18 | |
| 19 | class IAsyncExecutionCallback |
| 20 | { |
| 21 | public: |
| 22 | virtual ~IAsyncExecutionCallback() {}; |
| 23 | |
| 24 | // Notify the AsyncExecutionCallback object of the armnn execution status |
| 25 | virtual void Notify(armnn::Status status, InferenceTimingPair timeTaken) = 0; |
| 26 | |
| 27 | // Block the calling thread until the AsyncExecutionCallback object allows it to proceed |
| 28 | virtual void Wait() const = 0; |
| 29 | |
| 30 | // Retrieve the ArmNN Status from the AsyncExecutionCallback that has been notified |
| 31 | virtual armnn::Status GetStatus() const = 0; |
| 32 | |
| 33 | // Retrieve the start time before executing the inference |
| 34 | virtual HighResolutionClock GetStartTime() const = 0; |
| 35 | |
| 36 | // Retrieve the time after executing the inference |
| 37 | virtual HighResolutionClock GetEndTime() const = 0; |
| 38 | |
| 39 | }; |
| 40 | |
| 41 | } // experimental |
| 42 | |
| 43 | } // namespace armnn |