aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/fixtures/dynamic_fusion/operators/ClampFixture.h
diff options
context:
space:
mode:
authorViet-Hoa Do <viet-hoa.do@arm.com>2024-01-18 16:10:46 +0000
committerViet-Hoa Do <viet-hoa.do@arm.com>2024-01-23 09:52:40 +0000
commitfdf56fb9d414a754e7cedfdc1351ab0ce2866a0c (patch)
tree75b48446e9b4041ae9c520070e432d32b9748ef7 /tests/validation/fixtures/dynamic_fusion/operators/ClampFixture.h
parente812c0cafc6f224ec9caca30c2e97ec062012d53 (diff)
downloadComputeLibrary-fdf56fb9d414a754e7cedfdc1351ab0ce2866a0c.tar.gz
Make GpuWorkloadContext own all tensor info objects
* The tensor info objects created by calling create_tensor_info is now solely owned by the context object. The user only receives pointers to those objects. - Internally pointers to tensor info objects are used in various places. It's safer for dynamic fusion to manage these objects directly rather than relying on the users. - The validation test is updated to use the modified API. * Make various changes in dynamic fusion API to make it more friendly (e.g. making some of the objects moveable). Partially resolves: COMPMID-6707 Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Change-Id: Ifee70e53c05f8e7b72bf9ef123701ff291c5ee80 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10990 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Jakub Sujak <jakub.sujak@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests/validation/fixtures/dynamic_fusion/operators/ClampFixture.h')
-rw-r--r--tests/validation/fixtures/dynamic_fusion/operators/ClampFixture.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/validation/fixtures/dynamic_fusion/operators/ClampFixture.h b/tests/validation/fixtures/dynamic_fusion/operators/ClampFixture.h
index 3c325d739c..e8f6f83e42 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-2023 Arm Limited.
+ * Copyright (c) 2022-2024 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -21,8 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-#ifndef TESTS_VALIDATION_FIXTURES_DYNAMIC_FUSION_OPERATORS_CLAMPFIXTURE
-#define TESTS_VALIDATION_FIXTURES_DYNAMIC_FUSION_OPERATORS_CLAMPFIXTURE
+#ifndef ACL_TESTS_VALIDATION_FIXTURES_DYNAMIC_FUSION_OPERATORS_CLAMPFIXTURE_H
+#define ACL_TESTS_VALIDATION_FIXTURES_DYNAMIC_FUSION_OPERATORS_CLAMPFIXTURE_H
#include "arm_compute/core/CL/CLKernelLibrary.h"
#include "arm_compute/core/TensorInfo.h"
@@ -107,18 +107,18 @@ protected:
GpuWorkloadSketch sketch{ &context };
// Create sketch tensors
- TensorInfo src_info = context.create_tensor_info(TensorInfo(shape, 1, _data_type));
- TensorInfo dst_info = context.create_tensor_info(TensorInfo(shape, 1, _data_type));
+ ITensorInfo* src_info = context.create_tensor_info(TensorInfo(shape, 1, _data_type));
+ ITensorInfo* dst_info = context.create_tensor_info(TensorInfo(shape, 1, _data_type));
- ITensorInfo *ans_0_info = FunctionType::create_op(sketch, &src_info, attributes);
+ ITensorInfo *ans_0_info = FunctionType::create_op(sketch, src_info, attributes);
if(_fuse)
{
ITensorInfo *ans_1_info = FunctionType::create_op(sketch, ans_0_info, attributes);
- GpuOutput::create_op(sketch, ans_1_info, &dst_info);
+ 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
@@ -130,8 +130,8 @@ protected:
TensorType t_dst{};
// Initialize user tensors
- t_src.allocator()->init(src_info);
- t_dst.allocator()->init(dst_info);
+ t_src.allocator()->init(*src_info);
+ t_dst.allocator()->init(*dst_info);
// Allocate and fill user tensors
t_src.allocator()->allocate();
@@ -168,4 +168,4 @@ protected:
} // namespace validation
} // namespace test
} // namespace arm_compute
-#endif /* TESTS_VALIDATION_FIXTURES_DYNAMIC_FUSION_OPERATORS_CLAMPFIXTURE */
+#endif // ACL_TESTS_VALIDATION_FIXTURES_DYNAMIC_FUSION_OPERATORS_CLAMPFIXTURE_H