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

Class ClMatMul

src/gpu/cl/operators/ClMatMul.h:43–98  ·  view source on GitHub ↗

Basic operator to execute BatchMatMul on OpenCL. This operator calls the following OpenCL kernels: * * -# @ref kernels::ClMatMulNativeKernel */

Source from the content-addressed store, hash-verified

41 * -# @ref kernels::ClMatMulNativeKernel
42 */
43class ClMatMul : public IClOperator
44{
45public:
46 /** Constructor */
47 ClMatMul();
48 /** Default destructor */
49 ~ClMatMul() = default;
50 /** Initialise the kernel's inputs and output
51 *
52 * Valid data layouts:
53 * - All
54 *
55 * Valid data type configurations:
56 * |lhs |rhs |dst |
57 * |:--------------|:--------------|:--------------|
58 * |F32 |F32 |F32 |
59 * |F16 |F16 |F16 |
60 * |QASYMM8_SIGNED |QASYMM8_SIGNED |QASYMM8_SIGNED |
61 * |QASYMM8 |QASYMM8 |QASYMM8 |
62 *
63 * @note BatchMatMul: Batched Matrix Multiply - [A * B], Multiplies all slices (slice is an element of a batch) of Tensors A and B
64 * and stores the result in the dst tensor of the same batch size.
65 * Batch here is number of slices from A and B multiplied at a time, do not confuse with the batch dimension 'N' of NHWC/NCHW
66 * For NHWC for example: the batch is the higher dimensions H * N, and in general it is H * all higher dimensions.
67 * @note All tensors must have the same data type.
68 *
69 * @param[in] compile_context The compile context to be used.
70 * @param[in] lhs Left-hand side tensor info. Data types supported: F16/F32/QASYMM8_SIGNED/QASYMM8.
71 * @param[in] rhs Right-hand side tensor info. Data types supported: same as @p lhs.
72 * @param[out] dst Output tensor to store the result of the batched matrix multiplication. Data types supported: same as @p lhs.
73 * @param[in] matmul_info Contains MatMul operation information described in @ref MatMulInfo.
74 * @param[in] act_info Class containing information about fused activation function.
75 */
76 void configure(const CLCompileContext &compile_context,
77 ITensorInfo *lhs,
78 ITensorInfo *rhs,
79 ITensorInfo *dst,
80 const MatMulInfo &matmul_info,
81 const ActivationLayerInfo &act_info = ActivationLayerInfo());
82 /** Static function to check if given info will lead to a valid configuration
83 *
84 * Similar to @ref ClMatMul::configure()
85 *
86 * @return a status
87 */
88 static Status validate(const ITensorInfo *lhs,
89 const ITensorInfo *rhs,
90 const ITensorInfo *dst,
91 const MatMulInfo &matmul_info,
92 const ActivationLayerInfo &act_info = ActivationLayerInfo());
93 // Inherited methods overridden:
94 void run(ITensorPack &tensors) override;
95
96private:
97 std::unique_ptr<opencl::IClKernel> _matmul_kernel{nullptr};
98};
99} // namespace opencl
100} // namespace arm_compute

Callers

nothing calls this directly

Calls 1

ActivationLayerInfoClass · 0.50

Tested by

no test coverage detected