aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/dynamic_fusion/gpu/cl/Mul.cpp
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/dynamic_fusion/gpu/cl/Mul.cpp
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/dynamic_fusion/gpu/cl/Mul.cpp')
-rw-r--r--tests/validation/dynamic_fusion/gpu/cl/Mul.cpp56
1 files changed, 27 insertions, 29 deletions
diff --git a/tests/validation/dynamic_fusion/gpu/cl/Mul.cpp b/tests/validation/dynamic_fusion/gpu/cl/Mul.cpp
index b69479fb7e..c11bffe459 100644
--- a/tests/validation/dynamic_fusion/gpu/cl/Mul.cpp
+++ b/tests/validation/dynamic_fusion/gpu/cl/Mul.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023 Arm Limited.
+ * Copyright (c) 2023-2024 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -29,14 +29,13 @@
#include "arm_compute/dynamic_fusion/sketch/gpu/operators/GpuMul.h"
#include "tests/CL/CLAccessor.h"
-#include "tests/framework/Fixture.h"
-#include "tests/framework/Macros.h"
-#include "tests/framework/datasets/Datasets.h"
-#include "tests/validation/Validation.h"
-
#include "tests/datasets/DynamicFusionDataset.h"
#include "tests/datasets/ShapeDatasets.h"
+#include "tests/framework/datasets/Datasets.h"
+#include "tests/framework/Fixture.h"
+#include "tests/framework/Macros.h"
#include "tests/validation/fixtures/dynamic_fusion/operators/MulFixture.h"
+#include "tests/validation/Validation.h"
namespace arm_compute
{
@@ -58,8 +57,10 @@ namespace validation
*/
namespace
{
-constexpr AbsoluteTolerance<float> tolerance_f16(0.0001f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F16 */
-constexpr AbsoluteTolerance<float> tolerance_f32(0.0001f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F32 */
+constexpr AbsoluteTolerance<float> tolerance_f16(
+ 0.0001f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F16 */
+constexpr AbsoluteTolerance<float> tolerance_f32(
+ 0.0001f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F32 */
} // namespace
TEST_SUITE(CL)
TEST_SUITE(DYNAMIC_FUSION)
@@ -112,7 +113,7 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(
auto lhs_info = context.create_tensor_info(input1_info);
auto rhs_info = context.create_tensor_info(input2_info);
- bool res = bool(GpuMul::validate_op(sketch, &lhs_info, &rhs_info));
+ bool res = bool(GpuMul::validate_op(sketch, lhs_info, rhs_info));
ARM_COMPUTE_EXPECT(res == expected, framework::LogLevel::ERRORS);
}
// clang-format on
@@ -129,9 +130,8 @@ TEST_SUITE(F16)
FIXTURE_DATA_TEST_CASE(RunSmallOneOp,
DynamicFusionCLMulFixture<half>,
framework::DatasetMode::ALL,
- combine(combine(datasets::SmallShapes(),
- framework::dataset::make("DataType", { DataType::F16 })),
- framework::dataset::make("InPlace", { false })))
+ combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", {DataType::F16})),
+ framework::dataset::make("InPlace", {false})))
{
// Validate output
validate(CLAccessor(_target), _reference, tolerance_f16);
@@ -141,8 +141,8 @@ FIXTURE_DATA_TEST_CASE(RunSmallBroadcastOneOp,
DynamicFusionCLMulBroadcastFixture<half>,
framework::DatasetMode::PRECOMMIT,
combine(combine(datasets::TemporaryLimitedSmallShapesBroadcast(),
- framework::dataset::make("DataType", { DataType::F16 })),
- framework::dataset::make("InPlace", { false })))
+ framework::dataset::make("DataType", {DataType::F16})),
+ framework::dataset::make("InPlace", {false})))
{
// Validate output
validate(CLAccessor(_target), _reference, tolerance_f16);
@@ -152,8 +152,8 @@ FIXTURE_DATA_TEST_CASE(RunLargeBroadcastOneOp,
DynamicFusionCLMulBroadcastFixture<half>,
framework::DatasetMode::NIGHTLY,
combine(combine(datasets::TemporaryLimitedLargeShapesBroadcast(),
- framework::dataset::make("DataType", { DataType::F16 })),
- framework::dataset::make("InPlace", { false })))
+ framework::dataset::make("DataType", {DataType::F16})),
+ framework::dataset::make("InPlace", {false})))
{
// Validate output
validate(CLAccessor(_target), _reference, tolerance_f16);
@@ -164,9 +164,8 @@ TEST_SUITE(F32)
FIXTURE_DATA_TEST_CASE(RunSmallOneOp,
DynamicFusionCLMulFixture<float>,
framework::DatasetMode::PRECOMMIT,
- combine(combine(datasets::SmallShapes(),
- framework::dataset::make("DataType", { DataType::F32 })),
- framework::dataset::make("InPlace", { false })))
+ combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", {DataType::F32})),
+ framework::dataset::make("InPlace", {false})))
{
// Validate output
validate(CLAccessor(_target), _reference, tolerance_f32);
@@ -175,9 +174,8 @@ FIXTURE_DATA_TEST_CASE(RunSmallOneOp,
FIXTURE_DATA_TEST_CASE(RunLargeOneOp,
DynamicFusionCLMulFixture<float>,
framework::DatasetMode::NIGHTLY,
- combine(combine(datasets::LargeShapes(),
- framework::dataset::make("DataType", { DataType::F32 })),
- framework::dataset::make("InPlace", { false })))
+ combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType", {DataType::F32})),
+ framework::dataset::make("InPlace", {false})))
{
// Validate output
validate(CLAccessor(_target), _reference, tolerance_f32);
@@ -187,8 +185,8 @@ FIXTURE_DATA_TEST_CASE(RunSmallBroadcastOneOp,
DynamicFusionCLMulBroadcastFixture<float>,
framework::DatasetMode::PRECOMMIT,
combine(combine(datasets::TemporaryLimitedSmallShapesBroadcast(),
- framework::dataset::make("DataType", { DataType::F32 })),
- framework::dataset::make("InPlace", { false })))
+ framework::dataset::make("DataType", {DataType::F32})),
+ framework::dataset::make("InPlace", {false})))
{
// Validate output
validate(CLAccessor(_target), _reference, tolerance_f32);
@@ -198,8 +196,8 @@ FIXTURE_DATA_TEST_CASE(RunLargeBroadcastOneOp,
DynamicFusionCLMulBroadcastFixture<float>,
framework::DatasetMode::NIGHTLY,
combine(combine(datasets::TemporaryLimitedLargeShapesBroadcast(),
- framework::dataset::make("DataType", { DataType::F32 })),
- framework::dataset::make("InPlace", { false })))
+ framework::dataset::make("DataType", {DataType::F32})),
+ framework::dataset::make("InPlace", {false})))
{
// Validate output
validate(CLAccessor(_target), _reference, tolerance_f32);
@@ -209,9 +207,9 @@ FIXTURE_DATA_TEST_CASE(RunSmallTwoOps,
DynamicFusionCLMulTwoOpsFixture<float>,
framework::DatasetMode::PRECOMMIT,
combine(combine(combine(datasets::DynamicFusionElementwiseBinaryTwoOpsSmallShapes(),
- framework::dataset::make("DataType", { DataType::F32 })),
- framework::dataset::make("InPlace", { false })),
- framework::dataset::make("FuseTwoOps", { true })))
+ framework::dataset::make("DataType", {DataType::F32})),
+ framework::dataset::make("InPlace", {false})),
+ framework::dataset::make("FuseTwoOps", {true})))
{
// Validate output
validate(CLAccessor(_target), _reference, tolerance_f32);