diff options
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; |