From cc2877368d5e15d9ea89d31c84ec651fc0fffd13 Mon Sep 17 00:00:00 2001 From: Gunes Bayir Date: Thu, 19 Jan 2023 15:56:00 +0000 Subject: Change dynamic fusion API to return destination tensor info The new dynamic fusion API is introduced in the following patch: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8906 For each operator (except Conv2D, which is migrated in the above patch), we - remove destination tensor from is_supported, validate and create calls - make create_op return ITensorInfo* to the intermediate destination object Affected operators: - DepthwiseConv2D - Cast - Elementwise Ops - Clamp - Reshape - Resize Resolves: COMPMID-5777 Change-Id: Ib60ec8a5f081752808455d7a7d790f2ed0627059 Signed-off-by: Gunes Bayir Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8991 Reviewed-by: Ramy Elgammal Reviewed-by: Jakub Sujak Dynamic-Fusion: Ramy Elgammal Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Benchmark: Arm Jenkins --- .../validation/dynamic_fusion/gpu/Integration.cpp | 48 +++++------ tests/validation/dynamic_fusion/gpu/cl/Add.cpp | 59 +------------- tests/validation/dynamic_fusion/gpu/cl/Clamp.cpp | 23 ++---- .../dynamic_fusion/gpu/cl/DepthwiseConv2d.cpp | 93 ++++++---------------- tests/validation/dynamic_fusion/gpu/cl/Reshape.cpp | 23 +++--- tests/validation/dynamic_fusion/gpu/cl/Resize.cpp | 48 +++++------ .../dynamic_fusion/gpu/cl/DepthwiseConv2dFixture.h | 16 ++-- .../gpu/cl/ElementwiseBinaryFixture.h | 23 +++--- .../dynamic_fusion/operators/CastFixture.h | 8 +- .../dynamic_fusion/operators/ClampFixture.h | 20 ++--- .../dynamic_fusion/operators/ReshapeFixture.h | 10 +-- .../dynamic_fusion/operators/ResizeFixture.h | 8 +- 12 files changed, 116 insertions(+), 263 deletions(-) (limited to 'tests') diff --git a/tests/validation/dynamic_fusion/gpu/Integration.cpp b/tests/validation/dynamic_fusion/gpu/Integration.cpp index a70f512f9f..7f2d439183 100644 --- a/tests/validation/dynamic_fusion/gpu/Integration.cpp +++ b/tests/validation/dynamic_fusion/gpu/Integration.cpp @@ -158,20 +158,17 @@ TEST_CASE(Add_Output_Add_Output, framework::DatasetMode::ALL) auto gpu_ctx = GpuWorkloadContext{ &cl_compile_ctx }; GpuWorkloadSketch sketch{ &gpu_ctx }; - auto in_0_info = sketch.create_tensor_info(t_input_shape, 1, data_type); - auto in_1_info = sketch.create_tensor_info(t_input_shape, 1, data_type); - auto in_2_info = sketch.create_tensor_info(t_input_shape, 1, data_type); + TensorInfo in_0_info = sketch.create_tensor_info(t_input_shape, 1, data_type); + TensorInfo in_1_info = sketch.create_tensor_info(t_input_shape, 1, data_type); + TensorInfo in_2_info = sketch.create_tensor_info(t_input_shape, 1, data_type); - auto out_0_info = sketch.create_tensor_info(); - auto out_1_info = sketch.create_tensor_info(); + TensorInfo out_0_info = sketch.create_tensor_info(); + TensorInfo out_1_info = sketch.create_tensor_info(); - auto ans_0_info = sketch.create_tensor_info(); - auto ans_1_info = sketch.create_tensor_info(); - - GpuAdd::create_op(sketch, &in_0_info, &in_1_info, &ans_0_info); - GpuOutput::create_op(sketch, &ans_0_info, &out_0_info); - GpuAdd::create_op(sketch, &ans_0_info, &in_2_info, &ans_1_info); - GpuOutput::create_op(sketch, &ans_1_info, &out_1_info); + ITensorInfo *ans_0_info = GpuAdd::create_op(sketch, &in_0_info, &in_1_info); + GpuOutput::create_op(sketch, ans_0_info, &out_0_info); + ITensorInfo *ans_1_info = GpuAdd::create_op(sketch, ans_0_info, &in_2_info); + GpuOutput::create_op(sketch, ans_1_info, &out_1_info); // Configure runtime ClWorkloadRuntime runtime; @@ -257,17 +254,12 @@ TEST_CASE(Add_Output_Add_Cast_Cast_Output, framework::DatasetMode::ALL) auto gpu_ctx = GpuWorkloadContext{ &cl_compile_ctx }; GpuWorkloadSketch sketch{ &gpu_ctx }; - auto in_0_info = sketch.create_tensor_info(t_input_shape, 1, data_type); - auto in_1_info = sketch.create_tensor_info(t_input_shape, 1, data_type); - auto in_2_info = sketch.create_tensor_info(t_input_shape, 1, data_type); - - auto out_0_info = sketch.create_tensor_info(); - auto out_1_info = sketch.create_tensor_info(); + TensorInfo in_0_info = sketch.create_tensor_info(t_input_shape, 1, data_type); + TensorInfo in_1_info = sketch.create_tensor_info(t_input_shape, 1, data_type); + TensorInfo in_2_info = sketch.create_tensor_info(t_input_shape, 1, data_type); - auto ans_0_info = sketch.create_tensor_info(); - auto ans_1_info = sketch.create_tensor_info(); - auto ans_2_info = sketch.create_tensor_info(); - auto ans_3_info = sketch.create_tensor_info(); + TensorInfo out_0_info = sketch.create_tensor_info(); + TensorInfo out_1_info = sketch.create_tensor_info(); CastAttributes cast_0_attr; cast_0_attr.data_type(DataType::S32).convert_policy(ConvertPolicy::SATURATE); @@ -275,12 +267,12 @@ TEST_CASE(Add_Output_Add_Cast_Cast_Output, framework::DatasetMode::ALL) CastAttributes cast_1_attr; cast_1_attr.data_type(DataType::F32).convert_policy(ConvertPolicy::SATURATE); - GpuAdd::create_op(sketch, &in_0_info, &in_1_info, &ans_0_info); - GpuOutput::create_op(sketch, &ans_0_info, &out_0_info); - GpuAdd::create_op(sketch, &ans_0_info, &in_2_info, &ans_1_info); - GpuCast::create_op(sketch, &ans_1_info, &ans_2_info, cast_0_attr); - GpuCast::create_op(sketch, &ans_2_info, &ans_3_info, cast_1_attr); - GpuOutput::create_op(sketch, &ans_3_info, &out_1_info); + ITensorInfo *ans_0_info = GpuAdd::create_op(sketch, &in_0_info, &in_1_info); + GpuOutput::create_op(sketch, ans_0_info, &out_0_info); + ITensorInfo *ans_1_info = GpuAdd::create_op(sketch, ans_0_info, &in_2_info); + ITensorInfo *ans_2_info = GpuCast::create_op(sketch, ans_1_info, cast_0_attr); + ITensorInfo *ans_3_info = GpuCast::create_op(sketch, ans_2_info, cast_1_attr); + GpuOutput::create_op(sketch, ans_3_info, &out_1_info); // Configure runtime ClWorkloadRuntime runtime; diff --git a/tests/validation/dynamic_fusion/gpu/cl/Add.cpp b/tests/validation/dynamic_fusion/gpu/cl/Add.cpp index 1451ab3de8..0385407ad2 100644 --- a/tests/validation/dynamic_fusion/gpu/cl/Add.cpp +++ b/tests/validation/dynamic_fusion/gpu/cl/Add.cpp @@ -48,7 +48,7 @@ TEST_SUITE(ADD) // *INDENT-OFF* // clang-format off -DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( +DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip( framework::dataset::make("Input1Info", { TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), // Invalid data type combination TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::S16), // S16 is valid data type for Add @@ -71,41 +71,7 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( TensorInfo(TensorShape( 3U, 8U, 1U), 1, DataType::S16), TensorInfo(TensorShape(32U, 13U, 2U, 2), 1, DataType::F32), })), - framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), - TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), - TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::S16), - TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::S32), - TensorInfo(TensorShape(48U, 11U, 2U), 1, DataType::F32), - TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), - TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), - TensorInfo(TensorShape(15U, 23U, 3U), 1, DataType::F32), - TensorInfo(TensorShape( 3U, 8U, 9U), 1, DataType::S16), - TensorInfo(TensorShape(32U, 13U, 2U, 2), 1, DataType::F32), - })), framework::dataset::make("Expected", { true, false, true, true, false, true, true, false, false, true})), - input1_info, input2_info, output_info, expected) -{ - // Create a new workload sketch - auto cl_compile_ctx = CLKernelLibrary::get().get_compile_context(); - auto gpu_ctx = GpuWorkloadContext{ &cl_compile_ctx }; - GpuWorkloadSketch sketch{ &gpu_ctx }; - - // Fuse Elementwise Add - auto lhs_info = sketch.create_tensor_info(input1_info); - auto rhs_info = sketch.create_tensor_info(input2_info); - auto dst_info = sketch.create_tensor_info(output_info); - bool res = bool(GpuAdd::validate_op(sketch, &lhs_info, &rhs_info, &dst_info)); - ARM_COMPUTE_EXPECT(res == expected, framework::LogLevel::ERRORS); -} - -DATA_TEST_CASE(ValidateRhsInplace, framework::DatasetMode::ALL, zip(zip( - framework::dataset::make("Input1Info", { TensorInfo(TensorShape(32U, 1U, 1U), 1, DataType::F32), // Broadcasting allowed for lhs - TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), - }), - framework::dataset::make("Input2Info",{ TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), - TensorInfo(TensorShape(32U, 1U, 1U), 1, DataType::F32), // Broadcasting not allowed for rhs - })), - framework::dataset::make("Expected", { true, false})), input1_info, input2_info, expected) { // Create a new workload sketch @@ -116,29 +82,8 @@ DATA_TEST_CASE(ValidateRhsInplace, framework::DatasetMode::ALL, zip(zip( // Fuse Elementwise Add auto lhs_info = sketch.create_tensor_info(input1_info); auto rhs_info = sketch.create_tensor_info(input2_info); - bool res = bool(GpuAdd::validate_op(sketch, &lhs_info, &rhs_info, &rhs_info)); - ARM_COMPUTE_EXPECT(res == expected, framework::LogLevel::ERRORS); -} - -DATA_TEST_CASE(ValidateLhsInplace, framework::DatasetMode::ALL, zip(zip( - framework::dataset::make("Input1Info", { TensorInfo(TensorShape(32U, 1U, 1U), 1, DataType::F32), // Broadcasting not allowed for lhs - TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), - }), - framework::dataset::make("Input2Info",{ TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), - TensorInfo(TensorShape(32U, 1U, 1U), 1, DataType::F32), // Broadcasting allowed for rhs - })), - framework::dataset::make("Expected", { false, true})), - input1_info, input2_info, expected) -{ - // Create a new workload sketch - auto cl_compile_ctx = CLKernelLibrary::get().get_compile_context(); - auto gpu_ctx = GpuWorkloadContext{ &cl_compile_ctx }; - GpuWorkloadSketch sketch{ &gpu_ctx }; - // Fuse Elementwise Add - auto lhs_info = sketch.create_tensor_info(input1_info); - auto rhs_info = sketch.create_tensor_info(input2_info); - bool res = bool(GpuAdd::validate_op(sketch, &lhs_info, &rhs_info, &lhs_info)); + bool res = bool(GpuAdd::validate_op(sketch, &lhs_info, &rhs_info)); ARM_COMPUTE_EXPECT(res == expected, framework::LogLevel::ERRORS); } // clang-format on diff --git a/tests/validation/dynamic_fusion/gpu/cl/Clamp.cpp b/tests/validation/dynamic_fusion/gpu/cl/Clamp.cpp index 947201ff97..177c02c2c7 100644 --- a/tests/validation/dynamic_fusion/gpu/cl/Clamp.cpp +++ b/tests/validation/dynamic_fusion/gpu/cl/Clamp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Arm Limited. + * Copyright (c) 2022-2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -51,33 +51,21 @@ TEST_SUITE(DYNAMIC_FUSION) TEST_SUITE(CLAMP) // *INDENT-OFF* // clang-format off -DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip( +DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F16), - TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data types - TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching shapes TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Minimum value larger than maximum value }), - framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), - TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F16), - TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F16), - TensorInfo(TensorShape(30U, 11U, 2U), 1, DataType::F32), - TensorInfo(TensorShape(30U, 11U, 2U), 1, DataType::F32), - })), framework::dataset::make("MinVal", { 0.2f, 1.5f, - 0.1f, - 3.0f, 9.0f, })), framework::dataset::make("MaxVal", { 0.5f, 2.0f, 1.0f, - 4.0f, - 1.0f, })), - framework::dataset::make("Expected", { true, true, false, false, false })), - input_info, output_info, min_val, max_val, expected) + framework::dataset::make("Expected", { true, true, false })), + input_info, min_val, max_val, expected) { // Create a new workload sketch CLCompileContext cl_compile_ctx = CLKernelLibrary::get().get_compile_context(); @@ -86,13 +74,12 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip( // Fuse Clamp const TensorInfo src_info = sketch.create_tensor_info(input_info); - const TensorInfo dst_info = sketch.create_tensor_info(output_info); ClampAttributes attributes {}; attributes.min_val(min_val) .max_val(max_val); - const bool res = static_cast(GpuClamp::validate_op(sketch, &src_info, &dst_info, attributes)); + const bool res = static_cast(GpuClamp::validate_op(sketch, &src_info, attributes)); ARM_COMPUTE_EXPECT(res == expected, framework::LogLevel::ERRORS); } // clang-format on diff --git a/tests/validation/dynamic_fusion/gpu/cl/DepthwiseConv2d.cpp b/tests/validation/dynamic_fusion/gpu/cl/DepthwiseConv2d.cpp index f08cc60ea2..b6331d70c8 100644 --- a/tests/validation/dynamic_fusion/gpu/cl/DepthwiseConv2d.cpp +++ b/tests/validation/dynamic_fusion/gpu/cl/DepthwiseConv2d.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Arm Limited. + * Copyright (c) 2022-2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -53,31 +53,29 @@ constexpr float tolerance_num = 0.02f; /**< T // *INDENT-OFF* // clang-format off -DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(zip( - framework::dataset::make("InputInfo", { TensorInfo(TensorShape(2U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // Mismatching data type input/weights - TensorInfo(TensorShape(3U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // Mismatching input feature maps - TensorInfo(TensorShape(2U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // Mismatching depth multiplier - TensorInfo(TensorShape(2U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // Invalid biases size - TensorInfo(TensorShape(2U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // Invalid biases dimensions - TensorInfo(TensorShape(2U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // Invalid output size - TensorInfo(TensorShape(8U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // patch size bigger than input width - TensorInfo(TensorShape(8U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // dilation < 1 +DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip( // Explanations of failing tests + framework::dataset::make("InputInfo", { TensorInfo(TensorShape(2U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // Mismatching data type input/weights + TensorInfo(TensorShape(3U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // Mismatching input feature maps + TensorInfo(TensorShape(2U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // Mismatching depth multiplier + TensorInfo(TensorShape(2U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // Invalid biases size + TensorInfo(TensorShape(2U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // Invalid biases dimensions + TensorInfo(TensorShape(8U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // dilation < 1 TensorInfo(TensorShape(8U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), - TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::QASYMM8, DataLayout::NHWC), // Unsupported data type - TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::QASYMM8_SIGNED, DataLayout::NHWC), // Unsupported data type - TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::QSYMM16, DataLayout::NHWC), // Unsupported data type - TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::QSYMM8, DataLayout::NHWC), // Unsupported data type - TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::QSYMM8_PER_CHANNEL, DataLayout::NHWC), // Unsupported data type - TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::QASYMM16, DataLayout::NHWC), // Unsupported data type - TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::U8, DataLayout::NHWC), // Unsupported data type - TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::S8, DataLayout::NHWC), // Unsupported data type - TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::U16, DataLayout::NHWC), // Unsupported data type - TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::S16, DataLayout::NHWC), // Unsupported data type - TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::U32, DataLayout::NHWC), // Unsupported data type - TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::S32, DataLayout::NHWC), // Unsupported data type - TensorInfo(TensorShape(32U, 13U, 8U), 1, DataType::F32, DataLayout::NCHW), // Unsupported data layout + TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::QASYMM8, DataLayout::NHWC), // Unsupported data type + TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::QASYMM8_SIGNED, DataLayout::NHWC), // Unsupported data type + TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::QSYMM16, DataLayout::NHWC), // Unsupported data type + TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::QSYMM8, DataLayout::NHWC), // Unsupported data type + TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::QSYMM8_PER_CHANNEL, DataLayout::NHWC), // Unsupported data type + TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::QASYMM16, DataLayout::NHWC), // Unsupported data type + TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::U8, DataLayout::NHWC), // Unsupported data type + TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::S8, DataLayout::NHWC), // Unsupported data type + TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::U16, DataLayout::NHWC), // Unsupported data type + TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::S16, DataLayout::NHWC), // Unsupported data type + TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::U32, DataLayout::NHWC), // Unsupported data type + TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::S32, DataLayout::NHWC), // Unsupported data type + TensorInfo(TensorShape(32U, 13U, 8U), 1, DataType::F32, DataLayout::NCHW), // Unsupported data layout TensorInfo(TensorShape(8U, 32U, 13U, 4U), 1, DataType::F32, DataLayout::NHWC), - TensorInfo(TensorShape(8U, 32U, 13U, 4U), 1, DataType::F32, DataLayout::NHWC), // weight dimension > 3 + TensorInfo(TensorShape(8U, 32U, 13U, 4U), 1, DataType::F32, DataLayout::NHWC), // weight dimension > 3 TensorInfo(TensorShape(8U, 32U, 13U, 4U), 1, DataType::F32, DataLayout::NHWC), TensorInfo(TensorShape(8U, 32U, 13U, 4U), 1, DataType::F32, DataLayout::NHWC), TensorInfo(TensorShape(8U, 32U, 13U, 4U), 1, DataType::F32, DataLayout::NHWC), @@ -87,8 +85,6 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zi TensorInfo(TensorShape(2U, 3U, 3U, 2U), 1, DataType::F32, DataLayout::NHWC), TensorInfo(TensorShape(2U, 3U, 3U, 2U), 1, DataType::F32, DataLayout::NHWC), TensorInfo(TensorShape(2U, 3U, 3U, 2U), 1, DataType::F32, DataLayout::NHWC), - TensorInfo(TensorShape(2U, 3U, 3U, 2U), 1, DataType::F32, DataLayout::NHWC), - TensorInfo(TensorShape(16U, 3U, 3U), 1, DataType::F32, DataLayout::NHWC), TensorInfo(TensorShape(16U, 3U, 3U), 1, DataType::F32, DataLayout::NHWC), TensorInfo(TensorShape(16U, 3U, 3U), 1, DataType::F32, DataLayout::NHWC), TensorInfo(TensorShape(24U, 3U, 3U), 1, DataType::QASYMM8, DataLayout::NHWC), @@ -115,8 +111,6 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zi TensorInfo(TensorShape(2U), 1, DataType::F32, DataLayout::NHWC), TensorInfo(TensorShape(4U), 1, DataType::F32, DataLayout::NHWC), TensorInfo(TensorShape(2U, 2U), 1, DataType::F32, DataLayout::NHWC), - TensorInfo(TensorShape(2U), 1, DataType::F32, DataLayout::NHWC), - TensorInfo(TensorShape(16U), 1, DataType::F32, DataLayout::NHWC), TensorInfo(TensorShape(16U), 1, DataType::F32, DataLayout::NHWC), TensorInfo(TensorShape(16U), 1, DataType::F32, DataLayout::NHWC), TensorInfo(TensorShape(24U), 1, DataType::S32, DataLayout::NHWC), @@ -138,34 +132,6 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zi TensorInfo(TensorShape(24U), 1, DataType::F32, DataLayout::NHWC), TensorInfo(TensorShape(24U), 1, DataType::F32, DataLayout::NHWC), })), - framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(2U, 25U, 11U), 1, DataType::F32, DataLayout::NHWC), - TensorInfo(TensorShape(2U, 25U, 11U), 1, DataType::F32, DataLayout::NHWC), - TensorInfo(TensorShape(2U, 25U, 11U), 1, DataType::F32, DataLayout::NHWC), - TensorInfo(TensorShape(2U, 25U, 11U), 1, DataType::F32, DataLayout::NHWC), - TensorInfo(TensorShape(2U, 25U, 11U), 1, DataType::F32, DataLayout::NHWC), - TensorInfo(TensorShape(2U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), - TensorInfo(TensorShape(16U, 25U, 11U), 1, DataType::F32, DataLayout::NHWC), - TensorInfo(TensorShape(16U, 25U, 11U), 1, DataType::F32, DataLayout::NHWC), - TensorInfo(TensorShape(16U, 25U, 11U), 1, DataType::F32, DataLayout::NHWC), - TensorInfo(TensorShape(24U, 32U, 11U), 1, DataType::QASYMM8, DataLayout::NHWC), - TensorInfo(TensorShape(24U, 32U, 11U), 1, DataType::QASYMM8_SIGNED, DataLayout::NHWC), - TensorInfo(TensorShape(24U, 32U, 11U), 1, DataType::QSYMM16, DataLayout::NHWC), - TensorInfo(TensorShape(24U, 32U, 11U), 1, DataType::QSYMM8, DataLayout::NHWC), - TensorInfo(TensorShape(24U, 32U, 11U), 1, DataType::QSYMM8_PER_CHANNEL, DataLayout::NHWC), - TensorInfo(TensorShape(24U, 32U, 11U), 1, DataType::QASYMM16, DataLayout::NHWC), - TensorInfo(TensorShape(24U, 32U, 11U), 1, DataType::U8, DataLayout::NHWC), - TensorInfo(TensorShape(24U, 32U, 11U), 1, DataType::S8, DataLayout::NHWC), - TensorInfo(TensorShape(24U, 32U, 11U), 1, DataType::U16, DataLayout::NHWC), - TensorInfo(TensorShape(24U, 32U, 11U), 1, DataType::S16, DataLayout::NHWC), - TensorInfo(TensorShape(24U, 32U, 11U), 1, DataType::U32, DataLayout::NHWC), - TensorInfo(TensorShape(24U, 32U, 11U), 1, DataType::S32, DataLayout::NHWC), - TensorInfo(TensorShape(32U, 11U, 24U), 1, DataType::F32, DataLayout::NCHW), - TensorInfo(TensorShape(24U, 32U, 11U, 4U), 1, DataType::F32, DataLayout::NHWC), - TensorInfo(TensorShape(24U, 32U, 11U, 4U), 1, DataType::F32, DataLayout::NHWC), - TensorInfo(TensorShape(24U, 33U, 14U, 4U), 1, DataType::F32, DataLayout::NHWC), - TensorInfo(TensorShape(24U, 17U, 5U, 4U), 1, DataType::F32, DataLayout::NHWC), - TensorInfo(TensorShape(24U, 15U, 4U, 4U), 1, DataType::F32, DataLayout::NHWC), - })), framework::dataset::make("Padding", { Padding2D(0, 0, 0, 0), Padding2D(0, 0, 0, 0), Padding2D(0, 0, 0, 0), @@ -173,8 +139,6 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zi Padding2D(0, 0, 0, 0), Padding2D(0, 0, 0, 0), Padding2D(0, 0, 0, 0), - Padding2D(0, 0, 0, 0), - Padding2D(0, 0, 0, 0), Padding2D(1, 1, 0, 0), Padding2D(1, 1, 0, 0), Padding2D(1, 1, 0, 0), @@ -217,8 +181,6 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zi Size2D(1, 1), Size2D(1, 1), Size2D(1, 1), - Size2D(1, 1), - Size2D(1, 1), Size2D(2, 3), Size2D(2, 3), })), @@ -227,8 +189,6 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zi 3, 1, 1, - 1, - 2, 2, 2, 3, @@ -255,8 +215,6 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zi Size2D(1U, 1U), Size2D(1U, 1U), Size2D(1U, 1U), - Size2D(1U, 1U), - Size2D(20U, 1U), Size2D(0U, 1U), Size2D(1U, 1U), Size2D(1U, 1U), @@ -278,10 +236,10 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zi Size2D(1U, 1U), Size2D(2U, 3U), })), - framework::dataset::make("Expected", { false, false, false, false, false, false, false, false, true, false, + framework::dataset::make("Expected", { false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, true, true, true })), - input_info, weights_info, biases_info, output_info, padding, stride, depth_multiplier, dilation, expected) + input_info, weights_info, biases_info, padding, stride, depth_multiplier, dilation, expected) { CLCompileContext cl_compile_ctx = CLKernelLibrary::get().get_compile_context(); GpuWorkloadContext gpu_ctx = GpuWorkloadContext{ &cl_compile_ctx }; @@ -290,7 +248,6 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zi const TensorInfo sketch_input_info = sketch.create_tensor_info(input_info); const TensorInfo sketch_weights_info = sketch.create_tensor_info(weights_info); const TensorInfo sketch_biases_info = sketch.create_tensor_info(biases_info); - const TensorInfo sketch_output_info = sketch.create_tensor_info(output_info); DepthwiseConv2dAttributes attributes {}; attributes.pad(padding) @@ -298,7 +255,7 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zi .dilation(dilation) .depth_multiplier(depth_multiplier); - const Status status = GpuDepthwiseConv2d::validate_op(sketch, &sketch_input_info, &sketch_weights_info, &sketch_biases_info, &sketch_output_info, attributes); + const Status status = GpuDepthwiseConv2d::validate_op(sketch, &sketch_input_info, &sketch_weights_info, &sketch_biases_info, attributes); const bool res = bool(status); ARM_COMPUTE_EXPECT(res == expected, framework::LogLevel::ERRORS); } diff --git a/tests/validation/dynamic_fusion/gpu/cl/Reshape.cpp b/tests/validation/dynamic_fusion/gpu/cl/Reshape.cpp index b7a71db88a..51822b045a 100644 --- a/tests/validation/dynamic_fusion/gpu/cl/Reshape.cpp +++ b/tests/validation/dynamic_fusion/gpu/cl/Reshape.cpp @@ -44,17 +44,15 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip( TensorInfo(TensorShape(9U, 5U, 7U, 3U), 1, DataType::F32), TensorInfo(TensorShape(8U, 4U, 6U, 4U), 1, DataType::F32), TensorInfo(TensorShape(8U, 4U, 6U, 4U), 1, DataType::F32), // mismatching dimensions - TensorInfo(TensorShape(9U, 5U, 7U, 3U), 1, DataType::F16), // mismatching types }), -framework::dataset::make("OutputInfo", +framework::dataset::make("OutputShape", { - TensorInfo(TensorShape(9U, 5U, 21U), 1, DataType::F32), - TensorInfo(TensorShape(8U, 24U, 4U), 1, DataType::F32), - TensorInfo(TensorShape(192U, 192U), 1, DataType::F32), - TensorInfo(TensorShape(9U, 5U, 21U), 1, DataType::F32), + TensorShape(9U, 5U, 21U), + TensorShape(8U, 24U, 4U), + TensorShape(192U, 192U), })), -framework::dataset::make("Expected", { true, true, false, false })), -input_info, output_info, expected) +framework::dataset::make("Expected", { true, true, false })), +input_info, output_shape, expected) { // Create a new workload sketch auto cl_compile_ctx = CLKernelLibrary::get().get_compile_context(); @@ -62,13 +60,12 @@ input_info, output_info, expected) GpuWorkloadSketch sketch{ &gpu_ctx }; // Create sketch tensors - auto input_shape = input_info.tensor_shape(); - auto output_shape = output_info.tensor_shape(); - auto src_info = sketch.create_tensor_info(input_info); - auto dst_info = sketch.create_tensor_info(output_info); + TensorShape input_shape = input_info.tensor_shape(); + TensorInfo src_info = sketch.create_tensor_info(input_info); + ReshapeAttributes attributes; attributes.shape(output_shape); - Status status = GpuReshape::validate_op(sketch, &src_info, &dst_info, attributes); + Status status = GpuReshape::validate_op(sketch, &src_info, attributes); ARM_COMPUTE_EXPECT(bool(status) == expected, framework::LogLevel::ERRORS); } diff --git a/tests/validation/dynamic_fusion/gpu/cl/Resize.cpp b/tests/validation/dynamic_fusion/gpu/cl/Resize.cpp index 3791aef44c..696be54c92 100644 --- a/tests/validation/dynamic_fusion/gpu/cl/Resize.cpp +++ b/tests/validation/dynamic_fusion/gpu/cl/Resize.cpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2022 Arm Limited. +* Copyright (c) 2022-2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -86,8 +86,8 @@ TEST_SUITE(Validate) const auto default_input_shape = TensorShape{ 2, 3, 3, 2 }; const auto default_output_shape = TensorShape{ 4, 6, 3, 2 }; -constexpr auto default_data_type = DataType::U8; -constexpr auto default_data_layout = DataLayout::NHWC; +constexpr auto default_data_type = DataType::U8; +constexpr auto default_data_layout = DataLayout::NHWC; TEST_CASE(NullPtr, framework::DatasetMode::ALL) { @@ -98,15 +98,10 @@ TEST_CASE(NullPtr, framework::DatasetMode::ALL) GpuWorkloadContext gpu_ctx = GpuWorkloadContext{ &cl_compile_ctx }; GpuWorkloadSketch sketch{ &gpu_ctx }; - const TensorInfo sketch_input_info = sketch.create_tensor_info(input_info); - const TensorInfo sketch_output_info = sketch.create_tensor_info(output_info); + const TensorInfo sketch_input_info = sketch.create_tensor_info(input_info); // nullptr is given as input - Status status = GpuResize::validate_op(sketch, nullptr, &sketch_output_info, ResizeAttributes()); - ARM_COMPUTE_EXPECT(bool(status) == false, framework::LogLevel::ERRORS); - - // nullptr is given as output - status = GpuResize::validate_op(sketch, &sketch_input_info, nullptr, ResizeAttributes()); + Status status = GpuResize::validate_op(sketch, nullptr, ResizeAttributes()); ARM_COMPUTE_EXPECT(bool(status) == false, framework::LogLevel::ERRORS); } @@ -137,18 +132,19 @@ TEST_CASE(SupportDataType, framework::DatasetMode::ALL) for(auto &kv : supported_data_types) { - const TensorInfo input_info = TensorInfo{ default_input_shape, 1, kv.first, default_data_layout }; - const TensorInfo output_info = TensorInfo{ default_output_shape, 1, kv.first, default_data_layout }; + const TensorInfo input_info = TensorInfo{ default_input_shape, 1, kv.first, default_data_layout }; CLCompileContext cl_compile_ctx = CLKernelLibrary::get().get_compile_context(); GpuWorkloadContext gpu_ctx = GpuWorkloadContext{ &cl_compile_ctx }; GpuWorkloadSketch sketch{ &gpu_ctx }; - const TensorInfo sketch_input_info = sketch.create_tensor_info(input_info); - const TensorInfo sketch_output_info = sketch.create_tensor_info(output_info); + const TensorInfo sketch_input_info = sketch.create_tensor_info(input_info); + + ResizeAttributes attributes; + attributes.output_width(default_output_shape[0]); // shape is not important unless it's empty + attributes.output_height(default_output_shape[1]); - // nullptr is given as input - Status status = GpuResize::validate_op(sketch, &sketch_input_info, &sketch_output_info, ResizeAttributes()); + Status status = GpuResize::validate_op(sketch, &sketch_input_info, attributes); ARM_COMPUTE_EXPECT(bool(status) == kv.second, framework::LogLevel::ERRORS); } } @@ -164,10 +160,9 @@ TEST_CASE(MismatchingDataType, framework::DatasetMode::ALL) GpuWorkloadContext gpu_ctx = GpuWorkloadContext{ &cl_compile_ctx }; GpuWorkloadSketch sketch{ &gpu_ctx }; - const TensorInfo sketch_input_info = sketch.create_tensor_info(input_info); - const TensorInfo sketch_output_info = sketch.create_tensor_info(output_info); + const TensorInfo sketch_input_info = sketch.create_tensor_info(input_info); - Status status = GpuResize::validate_op(sketch, &sketch_input_info, &sketch_output_info, ResizeAttributes()); + Status status = GpuResize::validate_op(sketch, &sketch_input_info, ResizeAttributes()); ARM_COMPUTE_EXPECT(bool(status) == false, framework::LogLevel::ERRORS); } @@ -185,15 +180,14 @@ TEST_CASE(AlignedCornerNotSupported, framework::DatasetMode::ALL) GpuWorkloadContext gpu_ctx = GpuWorkloadContext{ &cl_compile_ctx }; GpuWorkloadSketch sketch{ &gpu_ctx }; - const TensorInfo sketch_input_info = sketch.create_tensor_info(input_info); - const TensorInfo sketch_output_info = sketch.create_tensor_info(output_info); + const TensorInfo sketch_input_info = sketch.create_tensor_info(input_info); ResizeAttributes attributes{}; attributes.interpolation_policy(interpolation_policy) .sampling_policy(sampling_policy) .align_corners(align_corners); - Status status = GpuResize::validate_op(sketch, &sketch_input_info, &sketch_output_info, attributes); + Status status = GpuResize::validate_op(sketch, &sketch_input_info, attributes); ARM_COMPUTE_EXPECT(bool(status) == false, framework::LogLevel::ERRORS); } @@ -207,13 +201,12 @@ TEST_CASE(UnsupportedInterpolationPolicy, framework::DatasetMode::ALL) GpuWorkloadContext gpu_ctx = GpuWorkloadContext{ &cl_compile_ctx }; GpuWorkloadSketch sketch{ &gpu_ctx }; - const TensorInfo sketch_input_info = sketch.create_tensor_info(input_info); - const TensorInfo sketch_output_info = sketch.create_tensor_info(output_info); + const TensorInfo sketch_input_info = sketch.create_tensor_info(input_info); ResizeAttributes attributes{}; attributes.interpolation_policy(interpolation_policy); - Status status = GpuResize::validate_op(sketch, &sketch_input_info, &sketch_output_info, attributes); + Status status = GpuResize::validate_op(sketch, &sketch_input_info, attributes); ARM_COMPUTE_EXPECT(bool(status) == false, framework::LogLevel::ERRORS); } @@ -227,13 +220,12 @@ TEST_CASE(UnsupportedLayout, framework::DatasetMode::ALL) GpuWorkloadContext gpu_ctx = GpuWorkloadContext{ &cl_compile_ctx }; GpuWorkloadSketch sketch{ &gpu_ctx }; - const TensorInfo sketch_input_info = sketch.create_tensor_info(input_info); - const TensorInfo sketch_output_info = sketch.create_tensor_info(output_info); + const TensorInfo sketch_input_info = sketch.create_tensor_info(input_info); ResizeAttributes attributes{}; attributes.interpolation_policy(interpolation_policy); - Status status = GpuResize::validate_op(sketch, &sketch_input_info, &sketch_output_info, attributes); + Status status = GpuResize::validate_op(sketch, &sketch_input_info, attributes); ARM_COMPUTE_EXPECT(bool(status) == false, framework::LogLevel::ERRORS); } diff --git a/tests/validation/fixtures/dynamic_fusion/gpu/cl/DepthwiseConv2dFixture.h b/tests/validation/fixtures/dynamic_fusion/gpu/cl/DepthwiseConv2dFixture.h index 630b664b78..235c8602b1 100644 --- a/tests/validation/fixtures/dynamic_fusion/gpu/cl/DepthwiseConv2dFixture.h +++ b/tests/validation/fixtures/dynamic_fusion/gpu/cl/DepthwiseConv2dFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Arm Limited. + * Copyright (c) 2022-2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -130,15 +130,13 @@ protected: GpuWorkloadSketch sketch{ &gpu_ctx }; // Create sketch tensors - auto input_info = sketch.create_tensor_info(TensorInfo(input_shape, 1, _data_type, _data_layout)); - auto weight_info = sketch.create_tensor_info(TensorInfo(weights_shape, 1, _data_type, _data_layout)); - auto bias_info = sketch.create_tensor_info(TensorInfo(bias_shape, 1, _data_type, _data_layout)); - auto dst_info = sketch.create_tensor_info(); + TensorInfo input_info = sketch.create_tensor_info(TensorInfo(input_shape, 1, _data_type, _data_layout)); + TensorInfo weight_info = sketch.create_tensor_info(TensorInfo(weights_shape, 1, _data_type, _data_layout)); + TensorInfo bias_info = sketch.create_tensor_info(TensorInfo(bias_shape, 1, _data_type, _data_layout)); + TensorInfo dst_info = sketch.create_tensor_info(); - auto ans_info = sketch.create_tensor_info(); - - FunctionType::create_op(sketch, &input_info, &weight_info, &bias_info, &ans_info, dwc_conv2d_attr); - GpuOutput::create_op(sketch, &ans_info, &dst_info); + ITensorInfo *ans_info = FunctionType::create_op(sketch, &input_info, &weight_info, &bias_info, dwc_conv2d_attr); + GpuOutput::create_op(sketch, ans_info, &dst_info); // Configure runtime ClWorkloadRuntime runtime; diff --git a/tests/validation/fixtures/dynamic_fusion/gpu/cl/ElementwiseBinaryFixture.h b/tests/validation/fixtures/dynamic_fusion/gpu/cl/ElementwiseBinaryFixture.h index f97b541ce3..e2722a1bdc 100644 --- a/tests/validation/fixtures/dynamic_fusion/gpu/cl/ElementwiseBinaryFixture.h +++ b/tests/validation/fixtures/dynamic_fusion/gpu/cl/ElementwiseBinaryFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Arm Limited. + * Copyright (c) 2022-2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -105,28 +105,23 @@ protected: GpuWorkloadSketch sketch{ &gpu_ctx }; // Fuse first element wise binary Op - auto lhs_info = sketch.create_tensor_info(shape0, 1, _data_type); - auto rhs_info = sketch.create_tensor_info(TensorInfo(shape1, 1, _data_type)); - - auto ans_info = sketch.create_tensor_info(); - auto dst_info = sketch.create_tensor_info(); + TensorInfo lhs_info = sketch.create_tensor_info(shape0, 1, _data_type); + TensorInfo rhs_info = sketch.create_tensor_info(TensorInfo(shape1, 1, _data_type)); + TensorInfo dst_info = sketch.create_tensor_info(); TensorInfo rhs_info_fuse; - TensorInfo ans2_info; - FunctionType::create_op(sketch, &lhs_info, &rhs_info, &ans_info); + ITensorInfo *ans_info = FunctionType::create_op(sketch, &lhs_info, &rhs_info); if(_fuse) { - rhs_info_fuse = sketch.create_tensor_info(shape2, 1, _data_type); - ans2_info = sketch.create_tensor_info(); - - FunctionType::create_op(sketch, &ans_info, &rhs_info_fuse, &ans2_info); - GpuOutput::create_op(sketch, &ans2_info, &dst_info); + rhs_info_fuse = sketch.create_tensor_info(shape2, 1, _data_type); + ITensorInfo *ans2_info = FunctionType::create_op(sketch, ans_info, &rhs_info_fuse); + GpuOutput::create_op(sketch, ans2_info, &dst_info); } else { - GpuOutput::create_op(sketch, &ans_info, &dst_info); + GpuOutput::create_op(sketch, ans_info, &dst_info); } // Configure runtime diff --git a/tests/validation/fixtures/dynamic_fusion/operators/CastFixture.h b/tests/validation/fixtures/dynamic_fusion/operators/CastFixture.h index 418cf4fe04..bd999027b3 100644 --- a/tests/validation/fixtures/dynamic_fusion/operators/CastFixture.h +++ b/tests/validation/fixtures/dynamic_fusion/operators/CastFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Arm Limited. + * Copyright (c) 2022-2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -122,10 +122,8 @@ protected: CastAttributes attributes; attributes.convert_policy(policy).data_type(dt_out); - auto ans_info = sketch.create_tensor_info(); - - FunctionType::create_op(sketch, &src_info, &ans_info, attributes); - GpuOutput::create_op(sketch, &ans_info, &dst_info); + ITensorInfo *ans_info = FunctionType::create_op(sketch, &src_info, attributes); + GpuOutput::create_op(sketch, ans_info, &dst_info); // Configure runtime ClWorkloadRuntime runtime; diff --git a/tests/validation/fixtures/dynamic_fusion/operators/ClampFixture.h b/tests/validation/fixtures/dynamic_fusion/operators/ClampFixture.h index fe87d9a022..a1fd22582f 100644 --- a/tests/validation/fixtures/dynamic_fusion/operators/ClampFixture.h +++ b/tests/validation/fixtures/dynamic_fusion/operators/ClampFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Arm Limited. + * Copyright (c) 2022-2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -94,8 +94,8 @@ protected: template void fill(U &&tensor) { - float min_bound = 0; - float max_bound = 0; + float min_bound = 0; + float max_bound = 0; std::tie(min_bound, max_bound) = get_activation_layer_test_bounds(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, _data_type); library->fill_static_values(tensor, get_boundary_values(static_cast(min_bound), static_cast(max_bound))); } @@ -111,21 +111,15 @@ protected: TensorInfo src_info = sketch.create_tensor_info(TensorInfo(shape, 1, _data_type)); TensorInfo dst_info = sketch.create_tensor_info(TensorInfo(shape, 1, _data_type)); - auto ans_0_info = sketch.create_tensor_info(); - TensorInfo ans_1_info; - - FunctionType::create_op(sketch, &src_info, &ans_0_info, attributes); - + ITensorInfo *ans_0_info = FunctionType::create_op(sketch, &src_info, attributes); if(_fuse) { - ans_1_info = sketch.create_tensor_info(); - - FunctionType::create_op(sketch, &ans_0_info, &ans_1_info, attributes); - GpuOutput::create_op(sketch, &ans_1_info, &dst_info); + ITensorInfo *ans_1_info = FunctionType::create_op(sketch, ans_0_info, attributes); + GpuOutput::create_op(sketch, ans_1_info, &dst_info); } else { - GpuOutput::create_op(sketch, &ans_0_info, &dst_info); + GpuOutput::create_op(sketch, ans_0_info, &dst_info); } // Configure runtime diff --git a/tests/validation/fixtures/dynamic_fusion/operators/ReshapeFixture.h b/tests/validation/fixtures/dynamic_fusion/operators/ReshapeFixture.h index a427d814cb..0d3b1f0296 100644 --- a/tests/validation/fixtures/dynamic_fusion/operators/ReshapeFixture.h +++ b/tests/validation/fixtures/dynamic_fusion/operators/ReshapeFixture.h @@ -75,13 +75,13 @@ protected: GpuWorkloadSketch sketch{ &gpu_ctx }; // Create sketch tensors - auto src_info = sketch.create_tensor_info(TensorInfo(input_shape, 1, data_type)); - auto ans_info = sketch.create_tensor_info(TensorInfo(output_shape, 1, data_type)); - auto dst_info = sketch.create_tensor_info(TensorInfo(output_shape, 1, data_type)); + TensorInfo src_info = sketch.create_tensor_info(TensorInfo(input_shape, 1, data_type)); + TensorInfo dst_info = sketch.create_tensor_info(TensorInfo(output_shape, 1, data_type)); ReshapeAttributes attributes; attributes.shape(output_shape); - FunctionType::create_op(sketch, &src_info, &ans_info, attributes); - GpuOutput::create_op(sketch, &ans_info, &dst_info); + + ITensorInfo *ans_info = FunctionType::create_op(sketch, &src_info, attributes); + GpuOutput::create_op(sketch, ans_info, &dst_info); // Configure runtime ClWorkloadRuntime runtime; diff --git a/tests/validation/fixtures/dynamic_fusion/operators/ResizeFixture.h b/tests/validation/fixtures/dynamic_fusion/operators/ResizeFixture.h index 5cdf52e62b..7eb820e0eb 100644 --- a/tests/validation/fixtures/dynamic_fusion/operators/ResizeFixture.h +++ b/tests/validation/fixtures/dynamic_fusion/operators/ResizeFixture.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2022 Arm Limited. +* Copyright (c) 2022-2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -148,10 +148,8 @@ protected: ResizeAttributes attributes; attributes.align_corners(_align_corners).sampling_policy(_sampling_policy).interpolation_policy(_interpolation_policy).output_width(_output_width).output_height(_output_height); - TensorInfo scale_result_info = sketch.create_tensor_info(); - - FunctionType::create_op(sketch, &src_info, &scale_result_info, attributes); - GpuOutput::create_op(sketch, &scale_result_info, &dst_info); + ITensorInfo *scale_result_info = FunctionType::create_op(sketch, &src_info, attributes); + GpuOutput::create_op(sketch, scale_result_info, &dst_info); // Configure runtime ClWorkloadRuntime runtime; -- cgit v1.2.1