diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-09-30 16:50:08 +0100 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-10-02 10:41:31 +0000 |
commit | 2ff0009ca9245304c48889c8ba8d3a39d42febed (patch) | |
tree | 055da4d101f451e5502f747375d1368b46eec391 /tests/validation/NEON/UNIT | |
parent | 58c71efe07031fc7ba82e61e2cdca8ae5ea13a8a (diff) | |
download | ComputeLibrary-2ff0009ca9245304c48889c8ba8d3a39d42febed.tar.gz |
COMPMID-2661: Implement complex function dynamic tensor support.
Change-Id: I80772cb25514009b030e5ade28cbb71ed352da67
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Reviewed-on: https://review.mlplatform.org/c/2019
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests/validation/NEON/UNIT')
-rw-r--r-- | tests/validation/NEON/UNIT/DynamicTensor.cpp | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/tests/validation/NEON/UNIT/DynamicTensor.cpp b/tests/validation/NEON/UNIT/DynamicTensor.cpp index 319aa6a8ee..dde67b06a6 100644 --- a/tests/validation/NEON/UNIT/DynamicTensor.cpp +++ b/tests/validation/NEON/UNIT/DynamicTensor.cpp @@ -22,19 +22,18 @@ * SOFTWARE. */ #include "arm_compute/runtime/Allocator.h" -#include "arm_compute/runtime/MemoryGroup.h" #include "arm_compute/runtime/MemoryManagerOnDemand.h" +#include "arm_compute/runtime/NEON/functions/NEConvolutionLayer.h" #include "arm_compute/runtime/NEON/functions/NENormalizationLayer.h" #include "arm_compute/runtime/OffsetLifetimeManager.h" #include "arm_compute/runtime/PoolManager.h" #include "support/ToolchainSupport.h" #include "tests/AssetsLibrary.h" -#include "tests/Globals.h" #include "tests/NEON/Accessor.h" -#include "tests/Utils.h" #include "tests/framework/Asserts.h" #include "tests/framework/Macros.h" #include "tests/framework/datasets/Datasets.h" +#include "tests/validation/Validation.h" #include "tests/validation/fixtures/UNIT/DynamicTensorFixture.h" namespace arm_compute @@ -45,6 +44,10 @@ namespace validation { namespace { +constexpr AbsoluteTolerance<float> absolute_tolerance_float(0.0001f); /**< Absolute Tolerance value for comparing reference's output against implementation's output for DataType::F32 */ +RelativeTolerance<float> tolerance_f32(0.1f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F32 */ +constexpr float tolerance_num = 0.07f; /**< Tolerance number */ + using NENormLayerWrapper = SimpleFunctionWrapper<MemoryManagerOnDemand, NENormalizationLayer, ITensor>; template <> void NENormLayerWrapper::configure(arm_compute::ITensor *src, arm_compute::ITensor *dst) @@ -55,7 +58,9 @@ void NENormLayerWrapper::configure(arm_compute::ITensor *src, arm_compute::ITens TEST_SUITE(NEON) TEST_SUITE(UNIT) TEST_SUITE(DynamicTensor) -using NEDynamicTensorType3SingleFunction = DynamicTensorType3SingleFunction<Tensor, Accessor, Allocator, OffsetLifetimeManager, PoolManager, MemoryManagerOnDemand, NENormLayerWrapper>; + +using OffsetMemoryManagementService = MemoryManagementService<Allocator, OffsetLifetimeManager, PoolManager, MemoryManagerOnDemand>; +using NEDynamicTensorType3SingleFunction = DynamicTensorType3SingleFunction<Tensor, Accessor, OffsetMemoryManagementService, NENormLayerWrapper>; /** Tests the memory manager with dynamic input and output tensors. * @@ -79,6 +84,28 @@ FIXTURE_DATA_TEST_CASE(DynamicTensorType3Single, NEDynamicTensorType3SingleFunct } } +using NEDynamicTensorType3ComplexFunction = DynamicTensorType3ComplexFunction<Tensor, Accessor, OffsetMemoryManagementService, NEConvolutionLayer>; +/** Tests the memory manager with dynamic input and output tensors. + * + * Create and manage the tensors needed to run a complex function. After the function is executed, + * change the input and output size requesting more memory and go through the manage/allocate process. + * The memory manager should be able to update the inner structures and allocate the requested memory + * */ +FIXTURE_DATA_TEST_CASE(DynamicTensorType3Complex, NEDynamicTensorType3ComplexFunction, framework::DatasetMode::ALL, + framework::dataset::zip(framework::dataset::zip(framework::dataset::zip(framework::dataset::zip( + framework::dataset::make("InputShape", { std::vector<TensorShape>{ TensorShape(12U, 12U, 6U), TensorShape(128U, 128U, 6U) } }), + framework::dataset::make("WeightsManager", { TensorShape(3U, 3U, 6U, 3U) })), + framework::dataset::make("BiasShape", { TensorShape(3U) })), + framework::dataset::make("OutputShape", { std::vector<TensorShape>{ TensorShape(12U, 12U, 3U), TensorShape(128U, 128U, 3U) } })), + framework::dataset::make("PadStrideInfo", { PadStrideInfo(1U, 1U, 1U, 1U) }))) +{ + for(unsigned int i = 0; i < num_iterations; ++i) + { + run_iteration(i); + validate(Accessor(dst_target), dst_ref, tolerance_f32, tolerance_num, absolute_tolerance_float); + } +} + TEST_SUITE_END() // DynamicTensor TEST_SUITE_END() // UNIT TEST_SUITE_END() // NEON |