MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / ClDirectConv2d

Class ClDirectConv2d

src/gpu/cl/operators/ClDirectConv2d.h:44–90  ·  view source on GitHub ↗

Basic function to simulate a directly convolution layer. This function calls the following OpenCL kernels: * * -# @ref CLFillBorderKernel (executed if padding size is different from zero) * -# @ref opencl::ClDirectConv2d */

Source from the content-addressed store, hash-verified

42 * -# @ref opencl::ClDirectConv2d
43 */
44class ClDirectConv2d : public IClOperator
45{
46public:
47 ClDirectConv2d() = default;
48 /** Set the src and dst tensors.
49 *
50 * @param[in] compile_context The compile context to be used.
51 * @param[in] src Source tensor. 3 lower dimensions represent a single src [width, height, IFM],
52 * while every optional dimension from 4 and above represent a batch of srcs.
53 * Data types supported: QASYMM8_SIGNED/QASYMM8/F16/F32.
54 * @param[in] weights Weights tensor. Weights are 4D tensor with dimensions [kernel_x, kernel_y, IFM, OFM]. Data type supported:Same as @p src.
55 * @param[in] biases Biases tensor. Shared biases supported. Biases are 1D tensor with dimensions [OFM].
56 * Data type supported: Should match @p src data type, except for src of QASYMM8 and QASYMM8_SIGNED type where biases should be of S32 type.
57 * @param[out] dst Destination tensor. 3 lower dimensions represent a single dst [width, height, OFM], while the rest represent batch of dsts.
58 * Data types supported: Same as @p src.
59 * @param[in] conv_info Contains padding and stride information described in @ref PadStrideInfo.
60 * @param[in] act_info (Optional) Activation layer information in case of a fused activation.
61 *
62 */
63 void configure(const CLCompileContext &compile_context,
64 ITensorInfo *src,
65 ITensorInfo *weights,
66 ITensorInfo *biases,
67 ITensorInfo *dst,
68 const PadStrideInfo &conv_info,
69 const ActivationLayerInfo &act_info = ActivationLayerInfo());
70 /** Static function to check if given info will lead to a valid configuration
71 *
72 * Similar to ClDirectConv2d::configure()
73 *
74 * @return a status
75 */
76 static Status validate(const ITensorInfo *src,
77 const ITensorInfo *weights,
78 const ITensorInfo *biases,
79 const ITensorInfo *dst,
80 const PadStrideInfo &conv_info,
81 const ActivationLayerInfo &act_info = ActivationLayerInfo());
82
83 // Inherited method overridden
84 void run(ITensorPack &tensors) override;
85
86private:
87 std::unique_ptr<IClKernel> _direct_conv_kernel{nullptr};
88 std::unique_ptr<IClKernel> _src_border_handler{nullptr};
89 std::unique_ptr<IClKernel> _activation_kernel{nullptr};
90};
91} // namespace opencl
92} // namespace arm_compute
93#endif /* ARM_COMPUTE_CL_DIRECT_CONV2D_H */

Callers

nothing calls this directly

Calls 1

ActivationLayerInfoClass · 0.50

Tested by

no test coverage detected