diff options
author | Sheri Zhang <sheri.zhang@arm.com> | 2020-04-07 11:04:57 +0100 |
---|---|---|
committer | Sheri Zhang <sheri.zhang@arm.com> | 2020-04-14 15:13:37 +0000 |
commit | b18252dce941001d8980721596709ea01d55747a (patch) | |
tree | 013d187c9bb5ab0704dd4e7c5f3f08e030d752b8 /tests/validation/fixtures | |
parent | 5a4fe19c23729f1e58e947ed15e865dc33c35ff6 (diff) | |
download | ComputeLibrary-b18252dce941001d8980721596709ea01d55747a.tar.gz |
COMPMID-3239: Implement QSYMM16 LayerNormalizationKernel for CL
Signed-off-by: Sheri Zhang <sheri.zhang@arm.com>
Change-Id: Ib1577c4a9aa29293a903731b2a4083b0d2243e1e
Signed-off-by: Sheri Zhang <sheri.zhang@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2994
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Sang-Hoon Park <sang-hoon.park@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Diffstat (limited to 'tests/validation/fixtures')
-rw-r--r-- | tests/validation/fixtures/QLSTMLayerNormalizationFixture.h | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/tests/validation/fixtures/QLSTMLayerNormalizationFixture.h b/tests/validation/fixtures/QLSTMLayerNormalizationFixture.h index 5d2cd2bd55..72af9d9241 100644 --- a/tests/validation/fixtures/QLSTMLayerNormalizationFixture.h +++ b/tests/validation/fixtures/QLSTMLayerNormalizationFixture.h @@ -26,6 +26,9 @@ #include "arm_compute/core/TensorShape.h" #include "arm_compute/core/Types.h" +#ifdef ARM_COMPUTE_CL +#include "arm_compute/runtime/CL/CLScheduler.h" +#endif /* ARM_COMPUTE_CL */ #include "arm_compute/runtime/NEON/NEScheduler.h" #include "tests/AssetsLibrary.h" #include "tests/Globals.h" @@ -98,6 +101,8 @@ protected: } } + virtual void run_target(FunctionType &fn) = 0; + TensorType compute_target(const TensorShape &input_shape, const TensorShape &weight_shape, const TensorShape &bias_shape) { TensorType input = create_tensor<TensorType>(input_shape, _data_type, 1); @@ -110,9 +115,7 @@ protected: allocate_tensors({ &input, &weight, &bias, &output }); fill(AccessorType(input), AccessorType(weight), AccessorType(bias)); - ThreadInfo tinfo; - tinfo.cpu_info = &NEScheduler::get().cpu_info(); - fn.run(fn.window(), tinfo); + run_target(fn); return output; } @@ -136,6 +139,31 @@ protected: QuantizationInfo _qinfo{}; }; +template <typename TensorType, typename AccessorType, typename FunctionType, typename T> +class NEQLSTMLayerNormalizationValidationFixture : public QLSTMLayerNormalizationValidationFixture<TensorType, AccessorType, FunctionType, T> +{ +protected: + void run_target(FunctionType &fn) override + { + ThreadInfo tinfo; + tinfo.cpu_info = &NEScheduler::get().cpu_info(); + fn.run(fn.window(), tinfo); + } +}; + +#ifdef ARM_COMPUTE_CL +template <typename TensorType, typename AccessorType, typename FunctionType, typename T> +class CLQLSTMLayerNormalizationValidationFixture : public QLSTMLayerNormalizationValidationFixture<TensorType, AccessorType, FunctionType, T> +{ +protected: + void run_target(FunctionType &fn) override + { + CLScheduler::get().default_init(); + fn.run(fn.window(), CLScheduler::get().queue()); + } +}; +#endif /* ARM_COMPUTE_CL */ + } // namespace validation } // namespace test } // namespace arm_compute |