aboutsummaryrefslogtreecommitdiff
path: root/src/backends/backendsCommon/ITensorHandleFactory.hpp
diff options
context:
space:
mode:
authorDerek Lamberti <derek.lamberti@arm.com>2019-08-01 15:56:25 +0100
committerÁron Virginás-Tar <aron.virginas-tar@arm.com>2019-08-05 13:51:42 +0000
commitf674aa0fd2809126debdaaeb8067067790d86907 (patch)
treed86d0261c7a25149217918986043c76d0823ee44 /src/backends/backendsCommon/ITensorHandleFactory.hpp
parent737d9ff58b348b11234b6c2363390607d576177d (diff)
downloadarmnn-f674aa0fd2809126debdaaeb8067067790d86907.tar.gz
IVGCVSW-3277 Mem export/import suppor for Tensors
* Rename MemoryStrategy to EdgeStrategy * Add MemImportLayer * Import memory rather than copy when possible Change-Id: I1d3a9414f2cbe517dc2aae9bbd4fdd92712b38ef Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
Diffstat (limited to 'src/backends/backendsCommon/ITensorHandleFactory.hpp')
-rw-r--r--src/backends/backendsCommon/ITensorHandleFactory.hpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/backends/backendsCommon/ITensorHandleFactory.hpp b/src/backends/backendsCommon/ITensorHandleFactory.hpp
index 7685061eb3..89a2a7fa3b 100644
--- a/src/backends/backendsCommon/ITensorHandleFactory.hpp
+++ b/src/backends/backendsCommon/ITensorHandleFactory.hpp
@@ -5,8 +5,9 @@
#pragma once
-#include <armnn/Types.hpp>
#include <armnn/IRuntime.hpp>
+#include <armnn/MemorySources.hpp>
+#include <armnn/Types.hpp>
namespace armnn
{
@@ -20,7 +21,6 @@ public:
virtual ~ITensorHandleFactory() {}
-
virtual std::unique_ptr<ITensorHandle> CreateSubTensorHandle(ITensorHandle& parent,
TensorShape const& subTensorShape,
unsigned int const* subTensorOrigin) const = 0;
@@ -33,17 +33,16 @@ public:
virtual bool SupportsMapUnmap() const final { return true; }
- virtual bool SupportsExport() const final { return false; }
-
- virtual bool SupportsImport() const final { return false; }
+ virtual MemorySourceFlags GetExportFlags() const { return 0; }
+ virtual MemorySourceFlags GetImportFlags() const { return 0; }
};
-enum class MemoryStrategy
+enum class EdgeStrategy
{
- Undefined,
- DirectCompatibility, // Only allocate the tensorhandle using the assigned factory
- CopyToTarget, // Default + Insert MemCopy node before target
- ExportToTarget, // Default + Insert Import node
+ Undefined, /// No strategy has been defined. Used internally to verify integrity of optimizations.
+ DirectCompatibility, /// Destination backend can work directly with tensors on source backend.
+ ExportToTarget, /// Source backends tensor data can be exported to destination backend tensor without copy.
+ CopyToTarget /// Copy contents from source backend tensor to destination backend tensor.
};
} //namespace armnn