diff options
author | Michele Di Giorgio <michele.digiorgio@arm.com> | 2019-09-05 12:30:22 +0100 |
---|---|---|
committer | Pablo Marquez <pablo.tello@arm.com> | 2019-09-27 16:20:14 +0000 |
commit | 6b612f5fa1fee9528f2f87491fe7edb3887d9817 (patch) | |
tree | 579ef443d61ed1319e5d8f44d8a7a8ce83c82aad /tests/validation/fixtures/ComputeAllAnchorsFixture.h | |
parent | 240b79de1c211ebb8d439b4a1c8c79777aa36f13 (diff) | |
download | ComputeLibrary-6b612f5fa1fee9528f2f87491fe7edb3887d9817.tar.gz |
COMPMID-2310: CLGenerateProposalsLayer: support for QASYMM8
Change-Id: I48b77e09857cd43f9498d28e8f4bf346e3d7110d
Signed-off-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Reviewed-on: https://review.mlplatform.org/c/1969
Reviewed-by: Pablo Marquez <pablo.tello@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests/validation/fixtures/ComputeAllAnchorsFixture.h')
-rw-r--r-- | tests/validation/fixtures/ComputeAllAnchorsFixture.h | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/tests/validation/fixtures/ComputeAllAnchorsFixture.h b/tests/validation/fixtures/ComputeAllAnchorsFixture.h index 6f2db3e623..e837bd4838 100644 --- a/tests/validation/fixtures/ComputeAllAnchorsFixture.h +++ b/tests/validation/fixtures/ComputeAllAnchorsFixture.h @@ -41,14 +41,14 @@ namespace test namespace validation { template <typename TensorType, typename AccessorType, typename FunctionType, typename T> -class ComputeAllAnchorsFixture : public framework::Fixture +class ComputeAllAnchorsGenericFixture : public framework::Fixture { public: template <typename...> - void setup(size_t num_anchors, const ComputeAnchorsInfo &info, DataType data_type) + void setup(size_t num_anchors, const ComputeAnchorsInfo &info, DataType data_type, QuantizationInfo qinfo) { - _target = compute_target(num_anchors, data_type, info); - _reference = compute_reference(num_anchors, data_type, info); + _target = compute_target(num_anchors, data_type, info, qinfo); + _reference = compute_reference(num_anchors, data_type, info, qinfo); } protected: @@ -58,11 +58,11 @@ protected: library->fill_tensor_uniform(tensor, 0, T(0), T(100)); } - TensorType compute_target(size_t num_anchors, DataType data_type, const ComputeAnchorsInfo &info) + TensorType compute_target(size_t num_anchors, DataType data_type, const ComputeAnchorsInfo &info, QuantizationInfo qinfo) { // Create tensors TensorShape anchors_shape(4, num_anchors); - TensorType anchors = create_tensor<TensorType>(anchors_shape, data_type); + TensorType anchors = create_tensor<TensorType>(anchors_shape, data_type, 1, qinfo); TensorType all_anchors; // Create and configure function @@ -88,10 +88,11 @@ protected: SimpleTensor<T> compute_reference(size_t num_anchors, DataType data_type, - const ComputeAnchorsInfo &info) + const ComputeAnchorsInfo &info, + QuantizationInfo qinfo) { // Create reference tensor - SimpleTensor<T> anchors(TensorShape(4, num_anchors), data_type); + SimpleTensor<T> anchors(TensorShape(4, num_anchors), data_type, 1, qinfo); // Fill reference tensor fill(anchors); @@ -101,6 +102,28 @@ protected: TensorType _target{}; SimpleTensor<T> _reference{}; }; + +template <typename TensorType, typename AccessorType, typename FunctionType, typename T> +class ComputeAllAnchorsFixture : public ComputeAllAnchorsGenericFixture<TensorType, AccessorType, FunctionType, T> +{ +public: + template <typename...> + void setup(size_t num_anchors, const ComputeAnchorsInfo &info, DataType data_type) + { + ComputeAllAnchorsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(num_anchors, info, data_type, QuantizationInfo()); + } +}; + +template <typename TensorType, typename AccessorType, typename FunctionType, typename T> +class ComputeAllAnchorsQuantizedFixture : public ComputeAllAnchorsGenericFixture<TensorType, AccessorType, FunctionType, T> +{ +public: + template <typename...> + void setup(size_t num_anchors, const ComputeAnchorsInfo &info, DataType data_type, QuantizationInfo qinfo) + { + ComputeAllAnchorsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(num_anchors, info, data_type, qinfo); + } +}; } // namespace validation } // namespace test } // namespace arm_compute |