diff options
author | Gian Marco Iodice <gianmarco.iodice@arm.com> | 2018-06-28 16:29:29 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:54:54 +0000 |
commit | 215b4ea6c9dee480a22070d5873b0b8cb52531a0 (patch) | |
tree | 398e552c4d01c0b84d03a873098a9183ba8f82e4 /tests/validation/fixtures | |
parent | ad486e21e5870f41774f30825c270762e08ae71e (diff) | |
download | ComputeLibrary-215b4ea6c9dee480a22070d5873b0b8cb52531a0.tar.gz |
COMPMID-1277 - Optimizing CLIm2ColKernel for NHWC.
This patch includes:
- Im2Col optimizations for NHWC using a new data layout
- Refactoring of CLIm2ColKernel adding validation method and auto-init
- Removed im2col_reduced from CLIm2ColKernel and created a new kernel CLFlattenLayerKernel
Change-Id: I1620640b6796baa268324b33ae92cdd8de53e27c
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/141241
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Giorgio Arena <giorgio.arena@arm.com>
Diffstat (limited to 'tests/validation/fixtures')
-rw-r--r-- | tests/validation/fixtures/FlattenLayerFixture.h | 2 | ||||
-rw-r--r-- | tests/validation/fixtures/Im2ColFixture.h | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/tests/validation/fixtures/FlattenLayerFixture.h b/tests/validation/fixtures/FlattenLayerFixture.h index f273e9315c..d17080695b 100644 --- a/tests/validation/fixtures/FlattenLayerFixture.h +++ b/tests/validation/fixtures/FlattenLayerFixture.h @@ -55,7 +55,7 @@ public: { TensorShape shape_flatten; TensorInfo input_info(shape, 1, data_type); - shape_flatten = compute_im2col_flatten_shape(&input_info); + shape_flatten = compute_flatten_shape(&input_info); _target = compute_target(shape, shape_flatten, data_type); _reference = compute_reference(shape, shape_flatten, data_type); diff --git a/tests/validation/fixtures/Im2ColFixture.h b/tests/validation/fixtures/Im2ColFixture.h index f72e38fefc..da2576b37c 100644 --- a/tests/validation/fixtures/Im2ColFixture.h +++ b/tests/validation/fixtures/Im2ColFixture.h @@ -49,7 +49,8 @@ class Im2ColValidationFixture : public framework::Fixture { public: template <typename...> - void setup(TensorShape input_shape, DataType data_type, const Size2D &kernel_dims, const PadStrideInfo &conv_info, const QuantizationInfo &quant_info, const DataLayout &data_layout) + void setup(TensorShape input_shape, DataType data_type, const Size2D &kernel_dims, const PadStrideInfo &conv_info, const QuantizationInfo &quant_info, const DataLayout &data_layout, + bool channels_first_output_nhwc) { _kernel_dims = kernel_dims; _conv_info = conv_info; @@ -68,7 +69,7 @@ public: const TensorShape output_shape = compute_im2col_conv_shape(&input_info, _kernel_dims, _conv_info, _has_bias, Size2D(1U, 1U), batch_size_on_z); _target = compute_target(input_shape, output_shape, data_type); - compute_reference(input_shape, output_shape, data_type); + compute_reference(input_shape, output_shape, data_type, channels_first_output_nhwc); } protected: @@ -107,14 +108,16 @@ protected: return dst; } - void compute_reference(const TensorShape &input_shape, const TensorShape &output_shape, DataType data_type) + void compute_reference(const TensorShape &input_shape, const TensorShape &output_shape, DataType data_type, bool channels_first_output_nhwc) { // Create reference SimpleTensor<T> src{ input_shape, data_type, 1, _quant_info, _data_layout }; _reference = SimpleTensor<T>(output_shape, data_type, 1, _quant_info, DataLayout::NCHW); + // Fill reference fill(src); - reference::im2col<T>(src, _reference, _kernel_dims, _conv_info, _has_bias); + + reference::im2col<T>(src, _reference, _kernel_dims, _conv_info, _has_bias, channels_first_output_nhwc); } TensorType _target{}; SimpleTensor<T> _reference{}; |