aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/NEON/UNIT/DynamicTensor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/validation/NEON/UNIT/DynamicTensor.cpp')
-rw-r--r--tests/validation/NEON/UNIT/DynamicTensor.cpp35
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