From 0cbb927ac309e332ac6e6f1ab9170f041f0138ab Mon Sep 17 00:00:00 2001 From: Michele Di Giorgio Date: Thu, 1 Mar 2018 16:56:48 +0000 Subject: COMPMID-804: Add NHWC data format support for NEON batch normalisation Change-Id: I04892e7be3f5aa58cd95917a4f90a6b4ffcf6efc Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/122897 Reviewed-by: Giorgio Arena Tested-by: Jenkins Reviewed-by: Anthony Barbier --- tests/benchmark/CL/BatchNormalizationLayer.cpp | 78 ++++++++++++---------- .../GLES_COMPUTE/BatchNormalizationLayer.cpp | 78 ++++++++++++---------- tests/benchmark/NEON/BatchNormalizationLayer.cpp | 78 ++++++++++++---------- .../fixtures/BatchNormalizationLayerFixture.h | 10 ++- 4 files changed, 133 insertions(+), 111 deletions(-) (limited to 'tests/benchmark') diff --git a/tests/benchmark/CL/BatchNormalizationLayer.cpp b/tests/benchmark/CL/BatchNormalizationLayer.cpp index 3312319aac..3d11aea1e7 100644 --- a/tests/benchmark/CL/BatchNormalizationLayer.cpp +++ b/tests/benchmark/CL/BatchNormalizationLayer.cpp @@ -51,54 +51,60 @@ using CLBatchNormalizationLayerFixture = BatchNormalizationLayerFixture - void setup(TensorShape tensor_shape, TensorShape param_shape, float epsilon, bool use_gamma, bool use_beta, ActivationLayerInfo act_info, DataType data_type, int batches) + void setup(TensorShape tensor_shape, TensorShape param_shape, float epsilon, bool use_gamma, bool use_beta, ActivationLayerInfo act_info, DataType data_type, DataLayout data_layout, int batches) { // Set batched in source and destination shapes const unsigned int fixed_point_position = 4; tensor_shape.set(tensor_shape.num_dimensions(), batches); + if(data_layout == DataLayout::NHWC) + { + permute(tensor_shape, PermutationVector(2U, 0U, 1U)); + } // Create tensors - src = create_tensor(tensor_shape, data_type, 1, fixed_point_position); - dst = create_tensor(tensor_shape, data_type, 1, fixed_point_position); + src = create_tensor(tensor_shape, data_type, 1, fixed_point_position, QuantizationInfo(), data_layout); + dst = create_tensor(tensor_shape, data_type, 1, fixed_point_position, QuantizationInfo(), data_layout); mean = create_tensor(param_shape, data_type, 1, fixed_point_position); variance = create_tensor(param_shape, data_type, 1, fixed_point_position); beta = create_tensor(param_shape, data_type, 1, fixed_point_position); -- cgit v1.2.1