aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFinn Williams <finn.williams@arm.com>2021-10-28 19:07:32 +0100
committerFinn Williams <finn.williams@arm.com>2021-11-08 14:33:17 +0000
commitb1aad4270fa8ad5c4aa62e27d564baf723b2cee5 (patch)
tree98b19ba85b50e2c730d5d2e3822cd2b1438bd149 /include
parent3f22d27f51c493e37b9da0692b6bf776f4430dcf (diff)
downloadarmnn-b1aad4270fa8ad5c4aa62e27d564baf723b2cee5.tar.gz
IVGCVSW-6527 Support the new memory API in loaded network
* enable external memory management for neon and ref backends * change m_TensorMemoryVector to hold shared pointers * change input layer backend Id to match backend id of connected layer Signed-off-by: Finn Williams <finn.williams@arm.com> Change-Id: I2216a724028312eb101b290df3f224177826b1a0
Diffstat (limited to 'include')
-rw-r--r--include/armnn/IRuntime.hpp14
-rw-r--r--include/armnn/backends/IMemoryOptimizerStrategy.hpp4
2 files changed, 12 insertions, 6 deletions
diff --git a/include/armnn/IRuntime.hpp b/include/armnn/IRuntime.hpp
index 93f8b0fd5b..bdfd9b224b 100644
--- a/include/armnn/IRuntime.hpp
+++ b/include/armnn/IRuntime.hpp
@@ -43,7 +43,8 @@ struct INetworkProperties
m_ProfilingEnabled(profilingEnabled),
m_OutputNetworkDetailsMethod(ProfilingDetailsMethod::Undefined),
m_InputSource(m_ImportEnabled ? MemorySource::Malloc : MemorySource::Undefined),
- m_OutputSource(m_ExportEnabled ? MemorySource::Malloc : MemorySource::Undefined)
+ m_OutputSource(m_ExportEnabled ? MemorySource::Malloc : MemorySource::Undefined),
+ m_ExternalMemoryManagementEnabled(false)
{}
ARMNN_DEPRECATED_MSG_REMOVAL_DATE("Please use INetworkProperties constructor without numThreads argument", "22.02")
@@ -58,7 +59,8 @@ struct INetworkProperties
m_ProfilingEnabled(profilingEnabled),
m_OutputNetworkDetailsMethod(ProfilingDetailsMethod::Undefined),
m_InputSource(inputSource),
- m_OutputSource(outputSource)
+ m_OutputSource(outputSource),
+ m_ExternalMemoryManagementEnabled(false)
{
armnn::IgnoreUnused(numThreads);
}
@@ -67,14 +69,16 @@ struct INetworkProperties
MemorySource inputSource,
MemorySource outputSource,
bool profilingEnabled = false,
- ProfilingDetailsMethod detailsMethod = ProfilingDetailsMethod::Undefined)
+ ProfilingDetailsMethod detailsMethod = ProfilingDetailsMethod::Undefined,
+ bool externalMemoryManagementEnabled = false)
: m_ImportEnabled(inputSource != MemorySource::Undefined),
m_ExportEnabled(outputSource != MemorySource::Undefined),
m_AsyncEnabled(asyncEnabled),
m_ProfilingEnabled(profilingEnabled),
m_OutputNetworkDetailsMethod(detailsMethod),
m_InputSource(inputSource),
- m_OutputSource(outputSource)
+ m_OutputSource(outputSource),
+ m_ExternalMemoryManagementEnabled(externalMemoryManagementEnabled)
{}
/// Deprecated and will be removed in future release.
@@ -91,6 +95,8 @@ struct INetworkProperties
const MemorySource m_InputSource;
const MemorySource m_OutputSource;
+ const bool m_ExternalMemoryManagementEnabled;
+
virtual ~INetworkProperties() {}
};
diff --git a/include/armnn/backends/IMemoryOptimizerStrategy.hpp b/include/armnn/backends/IMemoryOptimizerStrategy.hpp
index ad5513f8a3..bdb2f5bd30 100644
--- a/include/armnn/backends/IMemoryOptimizerStrategy.hpp
+++ b/include/armnn/backends/IMemoryOptimizerStrategy.hpp
@@ -19,8 +19,8 @@ struct MemBlock
const unsigned int index)
: m_StartOfLife(startOfLife), m_EndOfLife(endOfLife), m_MemSize(memSize), m_Offset(offset), m_Index(index) {}
- const unsigned int m_StartOfLife; // Y start
- const unsigned int m_EndOfLife; // Y end
+ const unsigned int m_StartOfLife; // Y start inclusive
+ const unsigned int m_EndOfLife; // Y end inclusive
const size_t m_MemSize; // Offset + Memsize = X end
size_t m_Offset; // X start