diff options
author | Matthew Bentham <Matthew.Bentham@arm.com> | 2019-06-24 12:51:25 +0100 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-07-02 09:19:19 +0000 |
commit | c394a6d17008f876c73e94883f0c59aeedfe73f0 (patch) | |
tree | 211b8aaad05f52302354ffeff97a60ac1892ae83 /src/backends/reference/workloads/RefElementwiseWorkload.cpp | |
parent | 4cefc4135f7fbf5c2ba532a4f5b14d2811f9ed9e (diff) | |
download | armnn-c394a6d17008f876c73e94883f0c59aeedfe73f0.tar.gz |
IVGCVSW-3307 Don't assume TensorInfo::Map() can be called before Execute()
Change-Id: I445c69d2e99d8c93622e739af61f721e61b0f90f
Signed-off-by: Matthew Bentham <Matthew.Bentham@arm.com>
Diffstat (limited to 'src/backends/reference/workloads/RefElementwiseWorkload.cpp')
-rw-r--r-- | src/backends/reference/workloads/RefElementwiseWorkload.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/backends/reference/workloads/RefElementwiseWorkload.cpp b/src/backends/reference/workloads/RefElementwiseWorkload.cpp index cbacd9c21e..6431348bc2 100644 --- a/src/backends/reference/workloads/RefElementwiseWorkload.cpp +++ b/src/backends/reference/workloads/RefElementwiseWorkload.cpp @@ -32,9 +32,9 @@ void RefElementwiseWorkload<Functor, ParentDescriptor, DebugString>::PostAllocat const TensorInfo& inputInfo1 = GetTensorInfo(m_Data.m_Inputs[1]); const TensorInfo& outputInfo = GetTensorInfo(m_Data.m_Outputs[0]); - m_Input0 = MakeDecoder<InType>(inputInfo0, m_Data.m_Inputs[0]->Map()); - m_Input1 = MakeDecoder<InType>(inputInfo1, m_Data.m_Inputs[1]->Map()); - m_Output = MakeEncoder<OutType>(outputInfo, m_Data.m_Outputs[0]->Map()); + m_Input0 = MakeDecoder<InType>(inputInfo0); + m_Input1 = MakeDecoder<InType>(inputInfo1); + m_Output = MakeEncoder<OutType>(outputInfo); } template <typename Functor, typename ParentDescriptor, typename armnn::StringMapping::Id DebugString> @@ -49,6 +49,10 @@ void RefElementwiseWorkload<Functor, ParentDescriptor, DebugString>::Execute() c const TensorShape& inShape1 = inputInfo1.GetShape(); const TensorShape& outShape = outputInfo.GetShape(); + m_Input0->Reset(m_Data.m_Inputs[0]->Map()); + m_Input1->Reset(m_Data.m_Inputs[1]->Map()); + m_Output->Reset(m_Data.m_Outputs[0]->Map()); + ElementwiseFunction<Functor>(inShape0, inShape1, outShape, |