aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/CL/functions/CLDequantizationLayer.cpp
diff options
context:
space:
mode:
authorManuel Bottini <manuel.bottini@arm.com>2021-03-02 17:40:42 +0000
committerManuel Bottini <manuel.bottini@arm.com>2021-03-11 18:24:52 +0000
commit9e73c93bbd49fdd648d8f8cb77df46e7bbc9526d (patch)
tree67f94008f7a8afbd95f00a0093d83af009aca87c /src/runtime/CL/functions/CLDequantizationLayer.cpp
parent6b0bf9972975aff01e42e5790f7b7c98cd835afb (diff)
downloadComputeLibrary-9e73c93bbd49fdd648d8f8cb77df46e7bbc9526d.tar.gz
Port OpenCL Dequantization to new API
Partially resolves: COMPMID-4193 Change-Id: I4e14149d5b0a7f9c0dd3bfce800eaddca1e4d885 Signed-off-by: Manuel Bottini <manuel.bottini@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5238 Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/runtime/CL/functions/CLDequantizationLayer.cpp')
-rw-r--r--src/runtime/CL/functions/CLDequantizationLayer.cpp39
1 files changed, 33 insertions, 6 deletions
diff --git a/src/runtime/CL/functions/CLDequantizationLayer.cpp b/src/runtime/CL/functions/CLDequantizationLayer.cpp
index d358813724..e0381f90ae 100644
--- a/src/runtime/CL/functions/CLDequantizationLayer.cpp
+++ b/src/runtime/CL/functions/CLDequantizationLayer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2020 Arm Limited.
+ * Copyright (c) 2017-2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -23,10 +23,27 @@
*/
#include "arm_compute/runtime/CL/functions/CLDequantizationLayer.h"
-#include "src/core/CL/kernels/CLDequantizationLayerKernel.h"
+#include "arm_compute/core/CL/CLKernelLibrary.h"
+#include "arm_compute/core/CL/ICLTensor.h"
+#include "arm_compute/core/KernelDescriptors.h"
+#include "src/core/CL/ICLKernel.h"
+#include "src/runtime/gpu/cl/operators/ClDequantization.h"
namespace arm_compute
{
+struct CLDequantizationLayer::Impl
+{
+ const ICLTensor *src{ nullptr };
+ ICLTensor *dst{ nullptr };
+ std::unique_ptr<opencl::ClDequantization> op{ nullptr };
+};
+
+CLDequantizationLayer::CLDequantizationLayer()
+ : _impl(std::make_unique<Impl>())
+{
+}
+CLDequantizationLayer::~CLDequantizationLayer() = default;
+
void CLDequantizationLayer::configure(const ICLTensor *input, ICLTensor *output)
{
configure(CLKernelLibrary::get().get_compile_context(), input, output);
@@ -34,13 +51,23 @@ void CLDequantizationLayer::configure(const ICLTensor *input, ICLTensor *output)
void CLDequantizationLayer::configure(const CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *output)
{
- auto k = std::make_unique<CLDequantizationLayerKernel>();
- k->configure(compile_context, input, output);
- _kernel = std::move(k);
+ _impl->src = input;
+ _impl->dst = output;
+
+ _impl->op = std::make_unique<opencl::ClDequantization>();
+ _impl->op->configure(compile_context, input->info(), output->info());
}
Status CLDequantizationLayer::validate(const ITensorInfo *input, const ITensorInfo *output)
{
- return CLDequantizationLayerKernel::validate(input, output);
+ return opencl::ClDequantization::validate(input, output);
+}
+
+void CLDequantizationLayer::run()
+{
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC, _impl->src);
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
+ _impl->op->run(pack);
}
} // namespace arm_compute