aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGiorgio Arena <giorgio.arena@arm.com>2018-04-25 12:07:29 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:52:54 +0000
commitdcb5b284300c34d5984091cfe99559cc420e59bb (patch)
tree2801819da649371088f47a6210d014e052af3473 /tests
parent028283c15a6c5d42c0794a733f7e26db84a1730a (diff)
downloadComputeLibrary-dcb5b284300c34d5984091cfe99559cc420e59bb.tar.gz
COMPMID-1048 Add NHWC data format support to Winograd filter transform 4x4_3x3
Change-Id: Ifd125fcb5451dbac3c28b15a9471048a74fee0ad Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/128987 Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/validation/CL/Winograd.cpp20
-rw-r--r--tests/validation/fixtures/WinogradConvolutionLayerFixture.h11
2 files changed, 20 insertions, 11 deletions
diff --git a/tests/validation/CL/Winograd.cpp b/tests/validation/CL/Winograd.cpp
index a61dd3f8f4..17dd58ffdc 100644
--- a/tests/validation/CL/Winograd.cpp
+++ b/tests/validation/CL/Winograd.cpp
@@ -203,10 +203,12 @@ DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(combi
}
FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradFilterTransformFixture, framework::DatasetMode::ALL,
- combine(combine(framework::dataset::concat(framework::dataset::concat(combine(datasets::Small3x3Shapes(), framework::dataset::make("OutputTile", Size2D(2U, 2U))), combine(datasets::Small3x3Shapes(),
- framework::dataset::make("OutputTile", Size2D(4U, 4U)))),
- combine(datasets::Small5x5Shapes(), framework::dataset::make("OutputTile", Size2D(4U, 4U)))),
- framework::dataset::make("DataLayout", { DataLayout::NCHW })),
+ combine(framework::dataset::concat(combine(framework::dataset::concat(framework::dataset::concat(combine(datasets::Small3x3Shapes(), framework::dataset::make("OutputTile", Size2D(2U, 2U))),
+ combine(datasets::Small3x3Shapes(),
+ framework::dataset::make("OutputTile", Size2D(4U, 4U)))),
+ combine(datasets::Small5x5Shapes(), framework::dataset::make("OutputTile", Size2D(4U, 4U)))),
+ framework::dataset::make("DataLayout", { DataLayout::NCHW })),
+ combine(combine(datasets::Small3x3Shapes(), framework::dataset::make("OutputTile", Size2D(4U, 4U))), framework::dataset::make("DataLayout", { DataLayout::NHWC }))),
framework::dataset::make("DataType", { DataType::F32 })))
{
// Validate output
@@ -214,10 +216,12 @@ FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradFilterTransformFixture, framework::Da
}
FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradFilterTransformFixture, framework::DatasetMode::NIGHTLY,
- combine(combine(framework::dataset::concat(framework::dataset::concat(combine(datasets::Large3x3Shapes(), framework::dataset::make("OutputTile", Size2D(2U, 2U))), combine(datasets::Large3x3Shapes(),
- framework::dataset::make("OutputTile", Size2D(4U, 4U)))),
- combine(datasets::Large5x5Shapes(), framework::dataset::make("OutputTile", Size2D(4U, 4U)))),
- framework::dataset::make("DataLayout", { DataLayout::NCHW })),
+ combine(framework::dataset::concat(combine(framework::dataset::concat(framework::dataset::concat(combine(datasets::Large3x3Shapes(), framework::dataset::make("OutputTile", Size2D(2U, 2U))),
+ combine(datasets::Large3x3Shapes(),
+ framework::dataset::make("OutputTile", Size2D(4U, 4U)))),
+ combine(datasets::Large5x5Shapes(), framework::dataset::make("OutputTile", Size2D(4U, 4U)))),
+ framework::dataset::make("DataLayout", { DataLayout::NCHW })),
+ combine(combine(datasets::Large3x3Shapes(), framework::dataset::make("OutputTile", Size2D(4U, 4U))), framework::dataset::make("DataLayout", { DataLayout::NHWC }))),
framework::dataset::make("DataType", { DataType::F32 })))
{
// Validate output
diff --git a/tests/validation/fixtures/WinogradConvolutionLayerFixture.h b/tests/validation/fixtures/WinogradConvolutionLayerFixture.h
index e23368add6..6381b99131 100644
--- a/tests/validation/fixtures/WinogradConvolutionLayerFixture.h
+++ b/tests/validation/fixtures/WinogradConvolutionLayerFixture.h
@@ -391,11 +391,16 @@ protected:
}
}
- TensorType compute_target(const TensorShape &input_shape, const TensorShape &output_shape, const WinogradInfo &winograd_info, DataLayout data_layout, DataType data_type)
+ TensorType compute_target(TensorShape input_shape, const TensorShape &output_shape, const WinogradInfo &winograd_info, DataLayout data_layout, DataType data_type)
{
+ if(data_layout == DataLayout::NHWC)
+ {
+ permute(input_shape, PermutationVector(2U, 0U, 1U));
+ }
+
// Create tensors
TensorType src = create_tensor<TensorType>(input_shape, data_type, 1, 0, QuantizationInfo(), data_layout);
- TensorType dst = create_tensor<TensorType>(output_shape, data_type, 1, 0, QuantizationInfo(), data_layout);
+ TensorType dst = create_tensor<TensorType>(output_shape, data_type, 1, 0, QuantizationInfo());
// Create and configure function
FunctionType filter_transform;
@@ -422,7 +427,7 @@ protected:
SimpleTensor<T> compute_reference(const TensorShape &input_shape, const TensorShape &output_shape, const WinogradInfo &winograd_info, DataLayout data_layout, DataType data_type)
{
// Create reference
- SimpleTensor<T> src{ input_shape, data_type, 1, 0, QuantizationInfo(), data_layout };
+ SimpleTensor<T> src{ input_shape, data_type, 1, 0, QuantizationInfo() };
// Fill reference
fill(src, 0, -1.f, 1.f);