aboutsummaryrefslogtreecommitdiff
path: root/include/armnn/IAsyncExecutionCallback.hpp
blob: 045ec4581f0f4acb2b0b6bd1241694565db4f91a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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