aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/kernels/CLCol2ImKernel.cpp
diff options
context:
space:
mode:
authorsteniu01 <steven.niu@arm.com>2017-07-27 15:42:44 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 14:16:42 +0100
commitcfc6fe8bffceb9acc5234985f6da73361abd56d7 (patch)
tree5c412f894dcfb2c9690707dddca91efb34c8dc90 /src/core/CL/kernels/CLCol2ImKernel.cpp
parente33eb645664e3525086a01b27674febc99ecf5c3 (diff)
downloadComputeLibrary-cfc6fe8bffceb9acc5234985f6da73361abd56d7.tar.gz
COMPMID-443 collapse higher dimension for CL col2im kernel
Change-Id: I99d41c7c95b8d4e3cd5c1685c68936b6a2db4192 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/81885 Reviewed-by: Anthony Barbier <anthony.barbier@arm.com> Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Diffstat (limited to 'src/core/CL/kernels/CLCol2ImKernel.cpp')
-rw-r--r--src/core/CL/kernels/CLCol2ImKernel.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/core/CL/kernels/CLCol2ImKernel.cpp b/src/core/CL/kernels/CLCol2ImKernel.cpp
index ddcc3fa41e..884c6d41a6 100644
--- a/src/core/CL/kernels/CLCol2ImKernel.cpp
+++ b/src/core/CL/kernels/CLCol2ImKernel.cpp
@@ -61,7 +61,8 @@ void CLCol2ImKernel::configure(const ICLTensor *input, ICLTensor *output, std::p
_kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("col2im", build_opts));
// Set static kernel arguments
- unsigned int idx = num_arguments_per_2D_tensor() + num_arguments_per_3D_tensor();
+ unsigned int idx = 2 * num_arguments_per_3D_tensor();
+ _kernel.setArg<cl_uint>(idx++, _output->info()->strides_in_bytes()[3]);
_kernel.setArg<cl_uint>(idx++, _convolved_dims.first);
// Configure window
@@ -79,16 +80,19 @@ void CLCol2ImKernel::run(const Window &window, cl::CommandQueue &queue)
{
ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this);
ARM_COMPUTE_ERROR_ON_MISMATCHING_WINDOWS(ICLKernel::window(), window);
+ // The collapse method rely on the assumption that the third dimension of input buffer is 1
+ ARM_COMPUTE_ERROR_ON(window.z().end() != 1);
+
+ Window collapsed_window = window.collapse_if_possible(ICLKernel::window(), Window::DimZ);
+ Window slice = collapsed_window.first_slice_window_3D();
- Window slice_in = window.first_slice_window_2D();
- Window slice_out = window.first_slice_window_3D();
do
{
// Set inputs
unsigned int idx = 0;
- add_2D_tensor_argument(idx, _input, slice_in);
- add_3D_tensor_argument(idx, _output, slice_out);
- enqueue(queue, *this, slice_in);
+ add_3D_tensor_argument(idx, _input, slice);
+ add_3D_tensor_argument(idx, _output, slice);
+ enqueue(queue, *this, slice);
}
- while(window.slide_window_slice_2D(slice_in) && window.slide_window_slice_3D(slice_out));
+ while(collapsed_window.slide_window_slice_3D(slice));
}