From 88627fbe2502018f6a93fcfc686b5a7f2d54a2a9 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Mon, 26 Feb 2018 20:33:40 +0000 Subject: COMPMID-959: Update valid region in DepthConcatenate Change-Id: I8aaf15a64aab592bfbdb386fdb07631cad933fa6 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/122307 Tested-by: Jenkins Reviewed-by: Anthony Barbier --- .../CL/functions/CLDepthConcatenateLayer.cpp | 5 ++++- .../NEON/functions/NEDepthConcatenateLayer.cpp | 5 ++++- tests/validation/CL/DepthConcatenateLayer.cpp | 21 ++++++++++++++++++++- tests/validation/NEON/DepthConcatenateLayer.cpp | 21 ++++++++++++++++++++- 4 files changed, 48 insertions(+), 4 deletions(-) diff --git a/src/runtime/CL/functions/CLDepthConcatenateLayer.cpp b/src/runtime/CL/functions/CLDepthConcatenateLayer.cpp index 05b5d54cf7..26d46a438c 100644 --- a/src/runtime/CL/functions/CLDepthConcatenateLayer.cpp +++ b/src/runtime/CL/functions/CLDepthConcatenateLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -64,6 +64,9 @@ void CLDepthConcatenateLayer::configure(std::vector inputs_vector, depth_offset += inputs_vector.at(i)->info()->dimension(2); } + + // Set valid region from shape + output->info()->set_valid_region(ValidRegion(Coordinates(), output_shape)); } void CLDepthConcatenateLayer::run() diff --git a/src/runtime/NEON/functions/NEDepthConcatenateLayer.cpp b/src/runtime/NEON/functions/NEDepthConcatenateLayer.cpp index 437c9417ce..930f8d5a26 100644 --- a/src/runtime/NEON/functions/NEDepthConcatenateLayer.cpp +++ b/src/runtime/NEON/functions/NEDepthConcatenateLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -62,6 +62,9 @@ void NEDepthConcatenateLayer::configure(std::vector inputs_vector, IT depth_offset += inputs_vector.at(i)->info()->dimension(2); } + + // Set valid region from shape + output->info()->set_valid_region(ValidRegion(Coordinates(), output_shape)); } void NEDepthConcatenateLayer::run() diff --git a/tests/validation/CL/DepthConcatenateLayer.cpp b/tests/validation/CL/DepthConcatenateLayer.cpp index 756499278a..725af88a17 100644 --- a/tests/validation/CL/DepthConcatenateLayer.cpp +++ b/tests/validation/CL/DepthConcatenateLayer.cpp @@ -42,7 +42,26 @@ namespace validation TEST_SUITE(CL) TEST_SUITE(DepthConcatenateLayer) -//TODO(COMPMID-415): Add configuration test? +TEST_CASE(Configuration, framework::DatasetMode::ALL) +{ + // Create tensors + CLTensor src1 = create_tensor(TensorShape(32U, 32U, 128U), DataType::F32, 1); + CLTensor src2 = create_tensor(TensorShape(32U, 32U, 32U), DataType::F32, 1); + CLTensor dst; + + ARM_COMPUTE_EXPECT(src1.info()->is_resizable(), framework::LogLevel::ERRORS); + ARM_COMPUTE_EXPECT(src2.info()->is_resizable(), framework::LogLevel::ERRORS); + ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); + + // Create and configure function + CLDepthConcatenateLayer concat_layer; + + concat_layer.configure({ &src1, &src2 }, &dst); + + // Validate valid region + const ValidRegion valid_region = shape_to_valid_region(TensorShape(32U, 32U, 160U)); + validate(dst.info()->valid_region(), valid_region); +} template using CLDepthConcatenateLayerFixture = DepthConcatenateLayerValidationFixture; diff --git a/tests/validation/NEON/DepthConcatenateLayer.cpp b/tests/validation/NEON/DepthConcatenateLayer.cpp index 581f6249bf..c3bb8a93b7 100644 --- a/tests/validation/NEON/DepthConcatenateLayer.cpp +++ b/tests/validation/NEON/DepthConcatenateLayer.cpp @@ -42,7 +42,26 @@ namespace validation TEST_SUITE(NEON) TEST_SUITE(DepthConcatenateLayer) -//TODO(COMPMID-415): Add configuration test? +TEST_CASE(Configuration, framework::DatasetMode::ALL) +{ + // Create tensors + Tensor src1 = create_tensor(TensorShape(32U, 32U, 128U), DataType::F32, 1); + Tensor src2 = create_tensor(TensorShape(32U, 32U, 32U), DataType::F32, 1); + Tensor dst; + + ARM_COMPUTE_EXPECT(src1.info()->is_resizable(), framework::LogLevel::ERRORS); + ARM_COMPUTE_EXPECT(src2.info()->is_resizable(), framework::LogLevel::ERRORS); + ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); + + // Create and configure function + NEDepthConcatenateLayer concat_layer; + + concat_layer.configure({ &src1, &src2 }, &dst); + + // Validate valid region + const ValidRegion valid_region = shape_to_valid_region(TensorShape(32U, 32U, 160U)); + validate(dst.info()->valid_region(), valid_region); +} template using NEDepthConcatenateLayerFixture = DepthConcatenateLayerValidationFixture; -- cgit v1.2.1