diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2018-02-26 20:33:40 +0000 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:48:11 +0000 |
commit | 88627fbe2502018f6a93fcfc686b5a7f2d54a2a9 (patch) | |
tree | 87bba23e28ef983fbc1923b454064e357ef10eaf | |
parent | abca1c98605e8e9eb767c6eb1df568812d9c32bb (diff) | |
download | ComputeLibrary-88627fbe2502018f6a93fcfc686b5a7f2d54a2a9.tar.gz |
COMPMID-959: Update valid region in DepthConcatenate
Change-Id: I8aaf15a64aab592bfbdb386fdb07631cad933fa6
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/122307
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
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<ICLTensor *> 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<ITensor *> 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<CLTensor>(TensorShape(32U, 32U, 128U), DataType::F32, 1); + CLTensor src2 = create_tensor<CLTensor>(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 <typename T> using CLDepthConcatenateLayerFixture = DepthConcatenateLayerValidationFixture<CLTensor, ICLTensor, CLAccessor, CLDepthConcatenateLayer, T>; 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<Tensor>(TensorShape(32U, 32U, 128U), DataType::F32, 1); + Tensor src2 = create_tensor<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 <typename T> using NEDepthConcatenateLayerFixture = DepthConcatenateLayerValidationFixture<Tensor, ITensor, Accessor, NEDepthConcatenateLayer, T>; |