From 595408218a0e17f04d91ff131a8227a4f352ff61 Mon Sep 17 00:00:00 2001 From: James Conroy Date: Thu, 11 Oct 2018 12:39:05 +0100 Subject: IVGCVSW-1978: Support NHWC for ResizeBilinear CpuRef * Adds implementation to plumb DataLayout parameter for ResizeBilinear on CpuRef. * Adds unit tests to execute ResizeBilinear on CpuRef using the NHWC data layout. * Adds DataLayoutIndexed API, allowing easy access to the Channels, Height and Width of a tensor based on its data layout. This reduces code duplication. * Refactors original ResizeBilinear implementation and tests to use the DataLayoutIndexed API when required. Change-Id: Ic2b8916cdd2e370d070175547079d774daf6d7bf --- src/armnn/InternalTypes.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/armnn/InternalTypes.cpp') diff --git a/src/armnn/InternalTypes.cpp b/src/armnn/InternalTypes.cpp index fce1e95429..67c596eec7 100644 --- a/src/armnn/InternalTypes.cpp +++ b/src/armnn/InternalTypes.cpp @@ -48,4 +48,16 @@ char const* GetLayerTypeAsCString(LayerType type) } } +// Definition in include/armnn/Types.hpp +bool operator==(const DataLayout& dataLayout, const DataLayoutIndexed& indexed) +{ + return dataLayout == indexed.GetDataLayout(); +} + +// Definition in include/armnn/Types.hpp +bool operator==(const DataLayoutIndexed& indexed, const DataLayout& dataLayout) +{ + return indexed.GetDataLayout() == dataLayout; +} + } -- cgit v1.2.1