aboutsummaryrefslogtreecommitdiff
path: root/src/dynamic_fusion/sketch/gpu/operators/GpuOutput.cpp
diff options
context:
space:
mode:
authorGunes Bayir <gunes.bayir@arm.com>2023-01-03 21:26:09 +0000
committerGunes Bayir <gunes.bayir@arm.com>2023-01-06 13:45:22 +0000
commit3a1e1256946028cb13f31521caec9f08235c7332 (patch)
treecc63b85bc30ecdc81d7218d7adf05d27a96e6411 /src/dynamic_fusion/sketch/gpu/operators/GpuOutput.cpp
parentb3077fbaee868579f9a41888fef1f71286d6757c (diff)
downloadComputeLibrary-3a1e1256946028cb13f31521caec9f08235c7332.tar.gz
Handle Intermediate tensors within the sketch
- Intermediate tensor info objects are not created by the user anymore. They're returned from create_op and reused. This will prevent allocation of the intermediate tensors in case of possible interface misuse. - Sketch object handles intermediate tensor info pointers inside its implementation class via a unique pointer vector - Conv2d operator is migrated into the new interface Resolves: COMPMID-5776 Change-Id: I9422e3681eef4f2d2922f6d0a5d7786380837c6d Signed-off-by: Gunes Bayir <gunes.bayir@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8906 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: SiCong Li <sicong.li@arm.com> Reviewed-by: Viet-Hoa Do <viet-hoa.do@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/dynamic_fusion/sketch/gpu/operators/GpuOutput.cpp')
-rw-r--r--src/dynamic_fusion/sketch/gpu/operators/GpuOutput.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/dynamic_fusion/sketch/gpu/operators/GpuOutput.cpp b/src/dynamic_fusion/sketch/gpu/operators/GpuOutput.cpp
index 60c2281433..cd5487c10b 100644
--- a/src/dynamic_fusion/sketch/gpu/operators/GpuOutput.cpp
+++ b/src/dynamic_fusion/sketch/gpu/operators/GpuOutput.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022 Arm Limited.
+ * Copyright (c) 2022-2023 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -24,12 +24,13 @@
#include "arm_compute/dynamic_fusion/sketch/gpu/operators/GpuOutput.h"
-#include "src/core/helpers/AutoConfiguration.h"
#include "src/common/utils/Log.h"
+#include "src/core/helpers/AutoConfiguration.h"
#include "src/dynamic_fusion/sketch/ArgumentPack.h"
#include "src/dynamic_fusion/sketch/gpu/GpuWorkloadSketchImpl.h"
#include "src/dynamic_fusion/sketch/gpu/components/cl/ClComponentStore.h"
+#include "src/dynamic_fusion/utils/Utils.h"
namespace arm_compute
{
@@ -65,7 +66,7 @@ Status GpuOutput::validate_op(const GpuWorkloadSketch &sketch,
{
ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(src, dst);
ARM_COMPUTE_RETURN_ERROR_ON(!src->has_valid_id());
- ARM_COMPUTE_RETURN_ERROR_ON(!dst->has_valid_id());
+ ARM_COMPUTE_RETURN_ERROR_ON(!is_user_tensor(dst));
// Initialize the destination tensor info.
TensorInfo dst_to_validate = *dst;
@@ -79,12 +80,11 @@ Status GpuOutput::validate_op(const GpuWorkloadSketch &sketch,
tensors.add_const_tensor(ACL_SRC_0, src);
tensors.add_const_tensor(ACL_DST_0, &dst_to_validate);
- const auto group = sketch.implementation().operator_group();
- const auto op = group.new_operator(operator_type, tensors);
+ const auto group = sketch.implementation().operator_group();
+ const auto op = group.new_operator(operator_type, tensors);
const auto success = group.try_add_operator(op, true);
ARM_COMPUTE_RETURN_ERROR_ON_MSG(!success, "This operator cannot be fused into the workload.");
- ARM_COMPUTE_UNUSED(success);
const auto status = is_supported_op(*sketch.gpu_context(), src, dst);
return status;
@@ -101,7 +101,7 @@ void GpuOutput::create_op(GpuWorkloadSketch &sketch,
auto_init_if_empty(*dst, *src);
// Translate into components and add to component graph
- auto &comp_graph = sketch.implementation().component_graph();
+ auto &comp_graph = sketch.implementation().component_graph();
const auto sketch_ctx = sketch.implementation().context();
if(sketch_ctx->gpu_language() == GpuLanguage::OpenCL)