diff options
author | Mike Kelly <mike.kelly@arm.com> | 2021-03-29 15:04:50 +0100 |
---|---|---|
committer | mike.kelly <mike.kelly@arm.com> | 2021-03-29 14:03:30 +0000 |
commit | 386ff1a721cdca3689b009ba31f2d3ac8bea2fae (patch) | |
tree | e2f5c26ab2601fd0be8c1223111f55cf1ff94e6e /include/armnn/IAsyncNetwork.hpp | |
parent | 23dbe3d3ff51c2b297ce5bf6360da6552f1c3bf5 (diff) | |
download | armnn-386ff1a721cdca3689b009ba31f2d3ac8bea2fae.tar.gz |
IVGCVSW-5790 Merge async prototype
* Added thread safe execution mechanism for armnn
* Removed duplicate function bool Compare(T a, T b, float tolerance)
* Added StridedSliceAsyncEndToEndTest
* Fixed memory leak
Signed-off-by: Mike Kelly <mike.kelly@arm.com>
Change-Id: I2d367fc77ee7c01b8953138543e76af5e691211f
Diffstat (limited to 'include/armnn/IAsyncNetwork.hpp')
-rw-r--r-- | include/armnn/IAsyncNetwork.hpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/include/armnn/IAsyncNetwork.hpp b/include/armnn/IAsyncNetwork.hpp new file mode 100644 index 0000000000..7ef83bbff1 --- /dev/null +++ b/include/armnn/IAsyncNetwork.hpp @@ -0,0 +1,51 @@ +// +// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +#include <armnn/NetworkFwd.hpp> + +#include "INetwork.hpp" +#include "IProfiler.hpp" +#include "IWorkingMemHandle.hpp" +#include "Tensor.hpp" +#include "Types.hpp" + +#include <mutex> + +namespace armnn +{ + +namespace experimental +{ + +class IAsyncNetwork +{ +public: + virtual ~IAsyncNetwork() {}; + + virtual TensorInfo GetInputTensorInfo(LayerBindingId layerId) const = 0; + virtual TensorInfo GetOutputTensorInfo(LayerBindingId layerId) const = 0; + + /// Thread safe execution of the network. Returns once execution is complete. + /// Will block until this and any other thread using the same workingMem object completes. + virtual Status Execute(const InputTensors& inputTensors, + const OutputTensors& outputTensors, + IWorkingMemHandle& workingMemHandle) = 0; + + /// Create a new unique WorkingMemHandle object. Create multiple handles if you wish to have + /// overlapped Execution by calling this function from different threads. + virtual std::unique_ptr<IWorkingMemHandle> CreateWorkingMemHandle() = 0; + + /// Get the profiler used for this network + virtual std::shared_ptr<IProfiler> GetProfiler() const = 0; + + /// Register a debug callback function to be used with this network + virtual void RegisterDebugCallback(const DebugCallbackFunction& func) = 0; +}; + +} // end experimental namespace + +} // end armnn namespace |