diff options
author | Pablo Tello <pablo.tello@arm.com> | 2019-09-24 11:03:47 +0100 |
---|---|---|
committer | Pablo Marquez <pablo.tello@arm.com> | 2019-10-15 14:05:55 +0000 |
commit | db8485ac24135f17e9882c76196924435abc064f (patch) | |
tree | dfe4ff6a50012ac93c6b1cf3fb29c099a7592522 /tests/validation | |
parent | a046e164b96a8441b2fa14ef578f7db46a0e97da (diff) | |
download | ComputeLibrary-db8485ac24135f17e9882c76196924435abc064f.tar.gz |
COMPMID-2205: CL runtime context.
CL Interfaces implemented.
Concrete classes implemented.
One test (ActivationLayer) ported to the new interface.
Change-Id: I283808bec36ccfc2f13fe048c45cbbee698ce525
Signed-off-by: Pablo Tello <pablo.tello@arm.com>
Reviewed-on: https://review.mlplatform.org/c/1998
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests/validation')
-rw-r--r-- | tests/validation/CL/ActivationLayer.cpp | 9 | ||||
-rw-r--r-- | tests/validation/fixtures/ActivationLayerFixture.h | 14 |
2 files changed, 16 insertions, 7 deletions
diff --git a/tests/validation/CL/ActivationLayer.cpp b/tests/validation/CL/ActivationLayer.cpp index 250777d541..a17ad9b269 100644 --- a/tests/validation/CL/ActivationLayer.cpp +++ b/tests/validation/CL/ActivationLayer.cpp @@ -95,15 +95,18 @@ TEST_SUITE(ActivationLayer) DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), CNNDataTypes), framework::dataset::make("InPlace", { false, true })), shape, data_type, in_place) { + // Create context + auto ctx = parameters->get_ctx<CLTensor>(); + // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type, 1); - CLTensor dst = create_tensor<CLTensor>(shape, data_type, 1); + CLTensor src = create_tensor<CLTensor>(shape, data_type, 1, QuantizationInfo(), DataLayout::NCHW, ctx); + CLTensor dst = create_tensor<CLTensor>(shape, data_type, 1, QuantizationInfo(), DataLayout::NCHW, ctx); ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); // Create and configure function - CLActivationLayer act_layer; + CLActivationLayer act_layer(ctx); if(in_place) { diff --git a/tests/validation/fixtures/ActivationLayerFixture.h b/tests/validation/fixtures/ActivationLayerFixture.h index 8fa74979a8..f6d43ddd89 100644 --- a/tests/validation/fixtures/ActivationLayerFixture.h +++ b/tests/validation/fixtures/ActivationLayerFixture.h @@ -29,9 +29,9 @@ #include "tests/AssetsLibrary.h" #include "tests/Globals.h" #include "tests/IAccessor.h" -#include "tests/ParametersLibrary.h" #include "tests/framework/Asserts.h" #include "tests/framework/Fixture.h" +#include "tests/framework/ParametersLibrary.h" #include "tests/validation/Helpers.h" #include "tests/validation/reference/ActivationLayer.h" @@ -47,6 +47,11 @@ template <typename TensorType, typename AccessorType, typename FunctionType, typ class ActivationValidationGenericFixture : public framework::Fixture { public: + ActivationValidationGenericFixture() + : _target(parameters->get_ctx<TensorType>()) + { + } + template <typename...> void setup(TensorShape shape, bool in_place, ActivationLayerInfo::ActivationFunction function, float alpha_beta, DataType data_type, QuantizationInfo quantization_info) { @@ -90,12 +95,13 @@ protected: TensorType compute_target(const TensorShape &shape, ActivationLayerInfo info) { + auto ctx = parameters->get_ctx<TensorType>(); // Create tensors - TensorType src = create_tensor<TensorType>(shape, _data_type, 1, _input_quantization_info); - TensorType dst = create_tensor<TensorType>(shape, _data_type, 1, _output_quantization_info); + TensorType src = create_tensor<TensorType>(shape, _data_type, 1, _input_quantization_info, DataLayout::NCHW, ctx); + TensorType dst = create_tensor<TensorType>(shape, _data_type, 1, _output_quantization_info, DataLayout::NCHW, ctx); // Create and configure function - FunctionType act_layer(parameters->get_ctx<TensorType>()); + FunctionType act_layer(ctx); TensorType *dst_ptr = _in_place ? nullptr : &dst; |