aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/dynamic_fusion/gpu/cl/Resize.cpp
diff options
context:
space:
mode:
authorViet-Hoa Do <viet-hoa.do@arm.com>2023-05-17 15:17:48 +0100
committerViet-Hoa Do <viet-hoa.do@arm.com>2023-06-12 14:41:18 +0000
commit3fcf3dcf7b6ffc613468ccaca580bde495677440 (patch)
tree567c85806318a868b0029f969cac823dd48fe44a /tests/validation/dynamic_fusion/gpu/cl/Resize.cpp
parent48cfd5f7895f13167e4e9cd974dbc1e983e04ed7 (diff)
downloadComputeLibrary-3fcf3dcf7b6ffc613468ccaca580bde495677440.tar.gz
Add multi-sketch support for dynamic fusion
* Tensors are owned by workload context instead of workload sketch so that they can be used by multiple sketches. * Add an integration test for multi-sketch case. Resolves: COMPMID-6148 Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Change-Id: I37d0de5ac103fb2a85020aa1c26e49eb304f47b7 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9706 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: SiCong Li <sicong.li@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests/validation/dynamic_fusion/gpu/cl/Resize.cpp')
-rw-r--r--tests/validation/dynamic_fusion/gpu/cl/Resize.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/tests/validation/dynamic_fusion/gpu/cl/Resize.cpp b/tests/validation/dynamic_fusion/gpu/cl/Resize.cpp
index 696be54c92..5f99cd6d78 100644
--- a/tests/validation/dynamic_fusion/gpu/cl/Resize.cpp
+++ b/tests/validation/dynamic_fusion/gpu/cl/Resize.cpp
@@ -95,10 +95,10 @@ TEST_CASE(NullPtr, framework::DatasetMode::ALL)
const TensorInfo output_info = TensorInfo{ default_output_shape, 1, default_data_type, default_data_layout };
CLCompileContext cl_compile_ctx = CLKernelLibrary::get().get_compile_context();
- GpuWorkloadContext gpu_ctx = GpuWorkloadContext{ &cl_compile_ctx };
- GpuWorkloadSketch sketch{ &gpu_ctx };
+ GpuWorkloadContext context = GpuWorkloadContext{ &cl_compile_ctx };
+ GpuWorkloadSketch sketch{ &context };
- const TensorInfo sketch_input_info = sketch.create_tensor_info(input_info);
+ const TensorInfo sketch_input_info = context.create_tensor_info(input_info);
// nullptr is given as input
Status status = GpuResize::validate_op(sketch, nullptr, ResizeAttributes());
@@ -135,10 +135,10 @@ TEST_CASE(SupportDataType, framework::DatasetMode::ALL)
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 };
+ GpuWorkloadContext context = GpuWorkloadContext{ &cl_compile_ctx };
+ GpuWorkloadSketch sketch{ &context };
- const TensorInfo sketch_input_info = sketch.create_tensor_info(input_info);
+ const TensorInfo sketch_input_info = context.create_tensor_info(input_info);
ResizeAttributes attributes;
attributes.output_width(default_output_shape[0]); // shape is not important unless it's empty
@@ -157,10 +157,10 @@ TEST_CASE(MismatchingDataType, framework::DatasetMode::ALL)
const TensorInfo output_info = TensorInfo{ default_output_shape, 1, non_default_data_type, default_data_layout };
CLCompileContext cl_compile_ctx = CLKernelLibrary::get().get_compile_context();
- GpuWorkloadContext gpu_ctx = GpuWorkloadContext{ &cl_compile_ctx };
- GpuWorkloadSketch sketch{ &gpu_ctx };
+ GpuWorkloadContext context = GpuWorkloadContext{ &cl_compile_ctx };
+ GpuWorkloadSketch sketch{ &context };
- const TensorInfo sketch_input_info = sketch.create_tensor_info(input_info);
+ const TensorInfo sketch_input_info = context.create_tensor_info(input_info);
Status status = GpuResize::validate_op(sketch, &sketch_input_info, ResizeAttributes());
ARM_COMPUTE_EXPECT(bool(status) == false, framework::LogLevel::ERRORS);
@@ -177,10 +177,10 @@ TEST_CASE(AlignedCornerNotSupported, framework::DatasetMode::ALL)
const TensorInfo output_info = TensorInfo{ default_output_shape, 1, default_data_type, default_data_layout };
CLCompileContext cl_compile_ctx = CLKernelLibrary::get().get_compile_context();
- GpuWorkloadContext gpu_ctx = GpuWorkloadContext{ &cl_compile_ctx };
- GpuWorkloadSketch sketch{ &gpu_ctx };
+ GpuWorkloadContext context = GpuWorkloadContext{ &cl_compile_ctx };
+ GpuWorkloadSketch sketch{ &context };
- const TensorInfo sketch_input_info = sketch.create_tensor_info(input_info);
+ const TensorInfo sketch_input_info = context.create_tensor_info(input_info);
ResizeAttributes attributes{};
attributes.interpolation_policy(interpolation_policy)
@@ -198,10 +198,10 @@ TEST_CASE(UnsupportedInterpolationPolicy, framework::DatasetMode::ALL)
constexpr auto interpolation_policy = InterpolationPolicy::AREA;
CLCompileContext cl_compile_ctx = CLKernelLibrary::get().get_compile_context();
- GpuWorkloadContext gpu_ctx = GpuWorkloadContext{ &cl_compile_ctx };
- GpuWorkloadSketch sketch{ &gpu_ctx };
+ GpuWorkloadContext context = GpuWorkloadContext{ &cl_compile_ctx };
+ GpuWorkloadSketch sketch{ &context };
- const TensorInfo sketch_input_info = sketch.create_tensor_info(input_info);
+ const TensorInfo sketch_input_info = context.create_tensor_info(input_info);
ResizeAttributes attributes{};
attributes.interpolation_policy(interpolation_policy);
@@ -217,10 +217,10 @@ TEST_CASE(UnsupportedLayout, framework::DatasetMode::ALL)
constexpr auto interpolation_policy = InterpolationPolicy::BILINEAR;
CLCompileContext cl_compile_ctx = CLKernelLibrary::get().get_compile_context();
- GpuWorkloadContext gpu_ctx = GpuWorkloadContext{ &cl_compile_ctx };
- GpuWorkloadSketch sketch{ &gpu_ctx };
+ GpuWorkloadContext context = GpuWorkloadContext{ &cl_compile_ctx };
+ GpuWorkloadSketch sketch{ &context };
- const TensorInfo sketch_input_info = sketch.create_tensor_info(input_info);
+ const TensorInfo sketch_input_info = context.create_tensor_info(input_info);
ResizeAttributes attributes{};
attributes.interpolation_policy(interpolation_policy);