diff options
author | Keith Davis <keith.davis@arm.com> | 2021-04-22 10:10:34 +0100 |
---|---|---|
committer | finn.williams <finn.williams@arm.com> | 2021-05-06 19:39:39 +0000 |
commit | e813d67f86df41a238ff79b5c554ef5027f56576 (patch) | |
tree | 54c2145a78297d61e6e94676729cb2468490ade3 /include/armnn/IAsyncExecutionCallback.hpp | |
parent | d905decd256558bbee165e636ce4242ac3b9c917 (diff) | |
download | armnn-e813d67f86df41a238ff79b5c554ef5027f56576.tar.gz |
IVGCVSW-5813 Add Async Queue to IRuntime
Signed-off-by: Keith Davis <keith.davis@arm.com>
Change-Id: Icc0d131c8ee2e9748e2f14762a75962b39c10f9d
Diffstat (limited to 'include/armnn/IAsyncExecutionCallback.hpp')
-rw-r--r-- | include/armnn/IAsyncExecutionCallback.hpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/include/armnn/IAsyncExecutionCallback.hpp b/include/armnn/IAsyncExecutionCallback.hpp new file mode 100644 index 0000000000..045ec4581f --- /dev/null +++ b/include/armnn/IAsyncExecutionCallback.hpp @@ -0,0 +1,43 @@ +// +// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +#include "Types.hpp" + +namespace armnn +{ + +namespace experimental +{ + +class IAsyncExecutionCallback; +using IAsyncExecutionCallbackPtr = std::shared_ptr<IAsyncExecutionCallback>; + +class IAsyncExecutionCallback +{ +public: + virtual ~IAsyncExecutionCallback() {}; + + // Notify the AsyncExecutionCallback object of the armnn execution status + virtual void Notify(armnn::Status status, InferenceTimingPair timeTaken) = 0; + + // Block the calling thread until the AsyncExecutionCallback object allows it to proceed + virtual void Wait() const = 0; + + // Retrieve the ArmNN Status from the AsyncExecutionCallback that has been notified + virtual armnn::Status GetStatus() const = 0; + + // Retrieve the start time before executing the inference + virtual HighResolutionClock GetStartTime() const = 0; + + // Retrieve the time after executing the inference + virtual HighResolutionClock GetEndTime() const = 0; + +}; + +} // experimental + +} // namespace armnn |