diff options
author | Mike Kelly <mike.kelly@arm.com> | 2021-08-04 17:27:40 +0100 |
---|---|---|
committer | Mike Kelly <mike.kelly@arm.com> | 2021-08-04 19:06:26 +0100 |
commit | 8c999dfeeca7b02a6ea1d0cdcd8c34472f6c9cce (patch) | |
tree | b307c2210745b663dde3ddf00769ae2e929599db /src/armnn/layers | |
parent | 554fa09a0f3d6c9c572634c9d2de9bfb6c3218b0 (diff) | |
download | armnn-8c999dfeeca7b02a6ea1d0cdcd8c34472f6c9cce.tar.gz |
Fixed bugs in PreCompiledLayer
* Fixed PreCompiledObject type (was const void** instead of void*)
* Fixed bug where a new shared_ptr was being created instead of allowing
std::move to convert the unique_ptr into a shared_ptr.
* Improved tests to ensure that the original pointer is maintained.
Signed-off-by: Mike Kelly <mike.kelly@arm.com>
Change-Id: I3f50d51775ee0180c894c2843ed7bc990a771dea
Diffstat (limited to 'src/armnn/layers')
-rw-r--r-- | src/armnn/layers/PreCompiledLayer.cpp | 2 | ||||
-rw-r--r-- | src/armnn/layers/PreCompiledLayer.hpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/armnn/layers/PreCompiledLayer.cpp b/src/armnn/layers/PreCompiledLayer.cpp index 0cc9c5a75a..67c1db4011 100644 --- a/src/armnn/layers/PreCompiledLayer.cpp +++ b/src/armnn/layers/PreCompiledLayer.cpp @@ -46,7 +46,7 @@ void PreCompiledLayer::ValidateTensorShapesFromInputs() void PreCompiledLayer::SetPreCompiledObject(PreCompiledObjectPtr preCompiledObject) { - m_PreCompiledObject = std::make_shared<const void*>(preCompiledObject.release()); + m_PreCompiledObject = std::move(preCompiledObject); } void PreCompiledLayer::Accept(ILayerVisitor& visitor) const diff --git a/src/armnn/layers/PreCompiledLayer.hpp b/src/armnn/layers/PreCompiledLayer.hpp index 6a8ac683ac..0db1472413 100644 --- a/src/armnn/layers/PreCompiledLayer.hpp +++ b/src/armnn/layers/PreCompiledLayer.hpp @@ -41,7 +41,7 @@ private: PreCompiledLayer(const PreCompiledLayer& other) = delete; PreCompiledLayer& operator=(const PreCompiledLayer& other) = delete; - std::shared_ptr<const void*> m_PreCompiledObject; + std::shared_ptr<void> m_PreCompiledObject; }; } // namespace armnn |