Compute Library
 22.08
CpuWinogradConv2dKernel.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2022 Arm Limited.
3  *
4  * SPDX-License-Identifier: MIT
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to
8  * deal in the Software without restriction, including without limitation the
9  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10  * sell copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #ifndef ARM_COMPUTE_CPUWINOGRADCONV2DKERNEL_H
25 #define ARM_COMPUTE_CPUWINOGRADCONV2DKERNEL_H
26 
30 #include "arm_compute/core/Steps.h"
33 #include "src/core/NEON/kernels/assembly/winograd.hpp"
34 #include "src/core/NEON/kernels/convolution/common/tensor.hpp"
35 #include "src/cpu/ICpuKernel.h"
36 
37 namespace arm_compute
38 {
39 namespace cpu
40 {
41 class CpuWinogradConv2dTransformInputKernel final : public ICpuKernel<CpuWinogradConv2dTransformInputKernel>
42 {
43 public:
44  /** Prevent instances of this class from being copied (As this class contains pointers) */
46 
47  /** Prevent instances of this class from being copied (As this class contains pointers) */
49 
50  /** Prevent instances of this class from being moved it contains references.*/
52 
53  /** Prevent instances of this class from being moved it contains references.*/
55 
56  CpuWinogradConv2dTransformInputKernel(arm_conv::winograd::WinogradImpl &w_impl, arm_conv::ConvolutionArgs &_c_args, uint32_t nthreads);
57 
58  // Inherited methods overridden:
59  void run_op(ITensorPack &tensors, const Window &window, const ThreadInfo &info) override;
60 
61  const char *name() const override
62  {
63  return "CpuWinogradConv2dTransformInputKernel";
64  }
65 
66 private:
67  arm_conv::winograd::WinogradImpl &_winograd_impl;
68  arm_conv::ConvolutionArgs &_conv_args;
69  uint32_t _nthreads;
70 };
71 class CpuWinogradConv2dTransformOutputKernel : public ICpuKernel<CpuWinogradConv2dTransformOutputKernel>
72 {
73 public:
74  /** Prevent instances of this class from being copied (As this class contains pointers) */
76 
77  /** Prevent instances of this class from being copied (As this class contains pointers) */
79 
80  /** Prevent instances of this class from being moved it contains references.*/
82 
83  /** Prevent instances of this class from being moved it contains references.*/
85 
86  CpuWinogradConv2dTransformOutputKernel(arm_conv::winograd::WinogradImpl &w_impl, arm_conv::ConvolutionArgs &_c_args, uint32_t nthreads);
87 
88  // Inherited methods overridden:
89  void run_op(ITensorPack &tensors, const Window &window, const ThreadInfo &info) override;
90 
91  const char *name() const override
92  {
93  return "CpuWinogradConv2dTransformOutputKernel";
94  }
95 
96 private:
97  arm_conv::winograd::WinogradImpl &_winograd_impl;
98  const arm_conv::ConvolutionArgs &_conv_args;
99  uint32_t _nthreads;
100 };
101 
102 } // namespace cpu
103 } // namespace arm_compute
104 #endif /*ARM_COMPUTE_CPUWINOGRADCONV2DKERNEL_H*/
const Window & window() const
The maximum window the kernel can be executed on.
Definition: IKernel.cpp:28
CpuWinogradConv2dTransformInputKernel(const CpuWinogradConv2dTransformInputKernel &)=delete
Prevent instances of this class from being copied (As this class contains pointers) ...
const char * name() const override
Name of the kernel.
const char * name() const override
Name of the kernel.
Copyright (c) 2017-2022 Arm Limited.
void run_op(ITensorPack &tensors, const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
CpuWinogradConv2dTransformInputKernel & operator=(const CpuWinogradConv2dTransformInputKernel &)=delete
Prevent instances of this class from being copied (As this class contains pointers) ...
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
Information about executing thread and CPU.
Definition: CPPTypes.h:179
Tensor packing service.
Definition: ITensorPack.h:39
Describe a multidimensional execution window.
Definition: Window.h:39