diff options
author | Gunes Bayir <gunes.bayir@arm.com> | 2023-01-19 15:56:00 +0000 |
---|---|---|
committer | Gunes Bayir <gunes.bayir@arm.com> | 2023-01-24 09:40:01 +0000 |
commit | cc2877368d5e15d9ea89d31c84ec651fc0fffd13 (patch) | |
tree | c57a3a406125b3a31e2d4aff6126ce99f4ade395 /tests/validation/dynamic_fusion/gpu/cl/Reshape.cpp | |
parent | a6a153817302793732e28b07c3b4046df3f91a60 (diff) | |
download | ComputeLibrary-cc2877368d5e15d9ea89d31c84ec651fc0fffd13.tar.gz |
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 <gunes.bayir@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8991
Reviewed-by: Ramy Elgammal <ramy.elgammal@arm.com>
Reviewed-by: Jakub Sujak <jakub.sujak@arm.com>
Dynamic-Fusion: Ramy Elgammal <ramy.elgammal@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests/validation/dynamic_fusion/gpu/cl/Reshape.cpp')
-rw-r--r-- | tests/validation/dynamic_fusion/gpu/cl/Reshape.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
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); } |