aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/CL
diff options
context:
space:
mode:
authorAdnan AlSinan <adnan.alsinan@arm.com>2023-10-24 11:05:56 +0100
committerAdnan AlSinan <adnan.alsinan@arm.com>2023-10-31 14:23:31 +0000
commit704c22f1373e1276acb43c71e7e17048271bbc03 (patch)
tree7cf8b5d4730c6482229a228215dd80b794088735 /src/runtime/CL
parent8f4b3df4c59c7b1c3fbea5b559862fcefeba14bf (diff)
downloadComputeLibrary-704c22f1373e1276acb43c71e7e17048271bbc03.tar.gz
[GPU] Update Reverse layer to allow negative axis and reversed axis order
- Adds option to use negative axis and inverted axis. - Adds validation tests for the above. Resolves COMPMID-6459 Change-Id: I88afd845d078f92c82ec8529ce7241fccd4c417e Signed-off-by: Adnan AlSinan <adnan.alsinan@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10523 Tested-by: Arm Jenkins <bsgcomp@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Viet-Hoa Do <viet-hoa.do@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/runtime/CL')
-rw-r--r--src/runtime/CL/functions/CLDirectDeconvolutionLayer.cpp2
-rw-r--r--src/runtime/CL/functions/CLFFTConvolutionLayer.cpp5
-rw-r--r--src/runtime/CL/functions/CLReverse.cpp18
3 files changed, 15 insertions, 10 deletions
diff --git a/src/runtime/CL/functions/CLDirectDeconvolutionLayer.cpp b/src/runtime/CL/functions/CLDirectDeconvolutionLayer.cpp
index 3717f30ae1..7cd268ab0b 100644
--- a/src/runtime/CL/functions/CLDirectDeconvolutionLayer.cpp
+++ b/src/runtime/CL/functions/CLDirectDeconvolutionLayer.cpp
@@ -161,7 +161,7 @@ void CLDirectDeconvolutionLayer::configure(const CLCompileContext &compile_conte
_original_weights = weights;
_flip_axis.allocator()->init(TensorInfo(TensorShape(2U), 1, DataType::U32));
_weights_flipped.allocator()->init(weights->info()->clone()->set_data_layout(data_layout));
- _flip_weights.configure(compile_context, weights, &_weights_flipped, &_flip_axis);
+ _flip_weights.configure(compile_context, weights, &_weights_flipped, &_flip_axis, /* use_inverted_axis */ false);
auto out_dims =
deconvolution_output_dimensions(input->info()->dimension(idx_w), input->info()->dimension(idx_h),
diff --git a/src/runtime/CL/functions/CLFFTConvolutionLayer.cpp b/src/runtime/CL/functions/CLFFTConvolutionLayer.cpp
index 3894b10785..2a73517549 100644
--- a/src/runtime/CL/functions/CLFFTConvolutionLayer.cpp
+++ b/src/runtime/CL/functions/CLFFTConvolutionLayer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2021 Arm Limited.
+ * Copyright (c) 2019-2021, 2023 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -181,7 +181,8 @@ void CLFFTConvolutionLayer::configure(const CLCompileContext &compile_context
// Flip weights
_flipped_weights.allocator()->init(weights_to_use->info()->clone()->set_is_resizable(true).reset_padding());
_flip_axis.allocator()->init(TensorInfo(TensorShape(2U), 1, DataType::U32));
- _flip_weights_func.configure(compile_context, weights_to_use, &_flipped_weights, &_flip_axis);
+ _flip_weights_func.configure(compile_context, weights_to_use, &_flipped_weights, &_flip_axis,
+ /* use_inverted_axis */ false);
// Pad weights
const PaddingList padding_w = {{0, input_dims.x() + pad_valid.x() - 1}, {0, input_dims.y() + pad_valid.y() - 1}};
diff --git a/src/runtime/CL/functions/CLReverse.cpp b/src/runtime/CL/functions/CLReverse.cpp
index 415de52e64..a20be2335a 100644
--- a/src/runtime/CL/functions/CLReverse.cpp
+++ b/src/runtime/CL/functions/CLReverse.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2021 Arm Limited.
+ * Copyright (c) 2018-2021, 2023 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -30,24 +30,28 @@
namespace arm_compute
{
-void CLReverse::configure(const ICLTensor *input, ICLTensor *output, const ICLTensor *axis)
+void CLReverse::configure(const ICLTensor *input, ICLTensor *output, const ICLTensor *axis, bool use_inverted_axis)
{
- configure(CLKernelLibrary::get().get_compile_context(), input, output, axis);
+ configure(CLKernelLibrary::get().get_compile_context(), input, output, axis, use_inverted_axis);
}
void CLReverse::configure(const CLCompileContext &compile_context,
const ICLTensor *input,
ICLTensor *output,
- const ICLTensor *axis)
+ const ICLTensor *axis,
+ bool use_inverted_axis)
{
ARM_COMPUTE_LOG_PARAMS(input, output, axis);
auto k = std::make_unique<CLReverseKernel>();
- k->configure(compile_context, input, output, axis);
+ k->configure(compile_context, input, output, axis, use_inverted_axis);
_kernel = std::move(k);
}
-Status CLReverse::validate(const ITensorInfo *input, const ITensorInfo *output, const ITensorInfo *axis)
+Status CLReverse::validate(const ITensorInfo *input,
+ const ITensorInfo *output,
+ const ITensorInfo *axis,
+ bool use_inverted_axis)
{
- return CLReverseKernel::validate(input, output, axis);
+ return CLReverseKernel::validate(input, output, axis, use_inverted_axis);
}
} // namespace arm_compute