IVGCVSW-1931: Refactor ClResizeBilinearFloatWorkload
authorJames Conroy <james.conroy@arm.com>
Tue, 2 Oct 2018 16:10:14 +0000 (17:10 +0100)
committerMatthew Bentham <matthew.bentham@arm.com>
Wed, 10 Oct 2018 15:16:58 +0000 (16:16 +0100)
* Refactored ClResizeBilinearFloatWorkload so that
  ConvertDataLayout is executed once only.

Change-Id: I3961847eaab65caa696c61fad665dc042556f098

src/backends/cl/workloads/ClResizeBilinearFloatWorkload.cpp

index 1a330354e41268eeef363d81e2cf4e35bf907d15..ced3a06b041962a3ed2136e1448bf58b8797c7d2 100644 (file)
@@ -26,8 +26,9 @@ ClResizeBilinearFloatWorkload::ClResizeBilinearFloatWorkload(const ResizeBilinea
     arm_compute::ICLTensor& input  = static_cast<IClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
     arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
 
-    (&input)->info()->set_data_layout(ConvertDataLayout(m_Data.m_Parameters.m_DataLayout));
-    (&output)->info()->set_data_layout(ConvertDataLayout(m_Data.m_Parameters.m_DataLayout));
+    arm_compute::DataLayout aclDataLayout = ConvertDataLayout(m_Data.m_Parameters.m_DataLayout);
+    input.info()->set_data_layout(aclDataLayout);
+    output.info()->set_data_layout(aclDataLayout);
 
     m_ResizeBilinearLayer.configure(&input, &output, arm_compute::InterpolationPolicy::BILINEAR,
                                     arm_compute::BorderMode::REPLICATE, arm_compute::PixelValue(0.f),