From c0f54434383f945d95f95549c1c4b0d5f5d2caff Mon Sep 17 00:00:00 2001 From: Giorgio Arena Date: Fri, 16 Mar 2018 14:02:34 +0000 Subject: COMPMID-808 Add NHWC data format support for NEON direct convolution Change-Id: I5d4cc3d5b0d25f3fe4ed998c0f15b1b8e260a43a Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/125697 Tested-by: Jenkins Reviewed-by: Georgios Pinitas Reviewed-by: Anthony Barbier --- tests/validation/NEON/DirectConvolutionLayer.cpp | 40 +++++++++++++----------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'tests/validation/NEON/DirectConvolutionLayer.cpp') diff --git a/tests/validation/NEON/DirectConvolutionLayer.cpp b/tests/validation/NEON/DirectConvolutionLayer.cpp index b6f9f62ff0..f700758d21 100644 --- a/tests/validation/NEON/DirectConvolutionLayer.cpp +++ b/tests/validation/NEON/DirectConvolutionLayer.cpp @@ -49,39 +49,39 @@ constexpr AbsoluteTolerance tolerance_fp16(0.01f); /**< Tolerance for ha constexpr AbsoluteTolerance tolerance_fp32(0.001f); /**< Tolerance for floating point tests */ /** Direct convolution data set. */ -const auto data_pad_f32 = concat(concat(combine(framework::dataset::make("PadX", 0, 1), - combine(framework::dataset::make("PadY", 0, 1), - framework::dataset::make("KernelSize", 1))), - combine(framework::dataset::make("PadX", 0, 2), - combine(framework::dataset::make("PadY", 0, 2), +const auto data_pad_f32 = concat(concat(combine(framework::dataset::make("PadX", { 0, 1 }), + combine(framework::dataset::make("PadY", { 0, 1 }), + framework::dataset::make("KernelSize", 3))), + combine(framework::dataset::make("PadX", { 0, 2 }), + combine(framework::dataset::make("PadY", { 0, 2 }), framework::dataset::make("KernelSize", 3)))), - combine(framework::dataset::make("PadX", 0, 3), - combine(framework::dataset::make("PadY", 0, 3), + combine(framework::dataset::make("PadX", { 0, 3 }), + combine(framework::dataset::make("PadY", { 0, 3 }), framework::dataset::make("KernelSize", 5)))); const auto data_pad_qs8 = concat(combine(framework::dataset::make("PadX", 0), combine(framework::dataset::make("PadY", 0), framework::dataset::make("KernelSize", 1))), - combine(framework::dataset::make("PadX", 0, 2), - combine(framework::dataset::make("PadY", 0, 2), + combine(framework::dataset::make("PadX", { 0, 2 }), + combine(framework::dataset::make("PadY", { 0, 2 }), framework::dataset::make("KernelSize", 3)))); const auto data_f32 = combine(datasets::SmallDirectConvolutionShapes(), - combine(framework::dataset::make("StrideX", 1, 3), - combine(framework::dataset::make("StrideY", 1, 3), + combine(framework::dataset::make("StrideX", { 1, 3 }), + combine(framework::dataset::make("StrideY", { 1, 3 }), combine(data_pad_f32, framework::dataset::make("NumKernels", { 1, 4, 8, 16 }))))); const auto data_qs8 = combine(datasets::TinyDirectConvolutionShapes(), - combine(framework::dataset::make("StrideX", 1, 3), - combine(framework::dataset::make("StrideY", 1, 3), + combine(framework::dataset::make("StrideX", { 1, 3 }), + combine(framework::dataset::make("StrideY", { 1, 3 }), combine(data_pad_qs8, framework::dataset::make("NumKernels", { 1, 4, 8, 16 }))))); /** Direct convolution QS16 data set. */ const auto data_qs16 = combine(datasets::TinyDirectConvolutionShapes(), - combine(framework::dataset::make("StrideX", 1, 3), - combine(framework::dataset::make("StrideY", 1, 3), + combine(framework::dataset::make("StrideX", { 1, 3 }), + combine(framework::dataset::make("StrideY", { 1, 3 }), combine(framework::dataset::make("PadX", 0), combine(framework::dataset::make("PadY", 0), combine(framework::dataset::make("KernelSize", 1), @@ -174,8 +174,9 @@ using NEDirectConvolutionLayerFixture = DirectConvolutionValidationFixture, framework::DatasetMode::ALL, combine(combine(data_f32, framework::dataset::make("DataType", DataType::F16)), - ActivationFunctionsDataset)) +FIXTURE_DATA_TEST_CASE(Run, NEDirectConvolutionLayerFixture, framework::DatasetMode::ALL, combine(combine(combine(data_f32, framework::dataset::make("DataType", DataType::F16)), + ActivationFunctionsDataset), + framework::dataset::make("DataLayout", DataLayout::NCHW))) { // Validate output validate(Accessor(_target), _reference, tolerance_fp16); @@ -184,8 +185,9 @@ TEST_SUITE_END() #endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */ TEST_SUITE(FP32) -FIXTURE_DATA_TEST_CASE(Run, NEDirectConvolutionLayerFixture, framework::DatasetMode::ALL, combine(combine(data_f32, framework::dataset::make("DataType", DataType::F32)), - ActivationFunctionsDataset)) +FIXTURE_DATA_TEST_CASE(Run, NEDirectConvolutionLayerFixture, framework::DatasetMode::ALL, combine(combine(combine(data_f32, framework::dataset::make("DataType", DataType::F32)), + ActivationFunctionsDataset), + framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(Accessor(_target), _reference, tolerance_fp32); -- cgit v1.2.1