aboutsummaryrefslogtreecommitdiff
path: root/src/backends/cl/ClTensorHandle.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/backends/cl/ClTensorHandle.hpp')
-rw-r--r--src/backends/cl/ClTensorHandle.hpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/backends/cl/ClTensorHandle.hpp b/src/backends/cl/ClTensorHandle.hpp
index 061117e9a6..5720d2cf11 100644
--- a/src/backends/cl/ClTensorHandle.hpp
+++ b/src/backends/cl/ClTensorHandle.hpp
@@ -57,7 +57,11 @@ public:
virtual void Allocate() override
{
// If we have enabled Importing, don't allocate the tensor
- if (!m_IsImportEnabled)
+ if (m_IsImportEnabled)
+ {
+ throw MemoryImportException("ClTensorHandle::Attempting to allocate memory when importing");
+ }
+ else
{
armnn::armcomputetensorutils::InitialiseArmComputeTensorEmpty(m_Tensor);
}
@@ -67,7 +71,11 @@ public:
virtual void Manage() override
{
// If we have enabled Importing, don't manage the tensor
- if (!m_IsImportEnabled)
+ if (m_IsImportEnabled)
+ {
+ throw MemoryImportException("ClTensorHandle::Attempting to manage memory when importing");
+ }
+ else
{
assert(m_MemoryGroup != nullptr);
m_MemoryGroup->manage(&m_Tensor);