blob: 790418bf50b95743c6f2950ad30b627f553cbfa8 [file] [log] [blame]
Adnan AlSinand9c1d442023-10-06 19:07:48 +01001/*
Gunes Bayir2b9fa592024-01-17 16:07:03 +00002 * Copyright (c) 2023-2024 Arm Limited.
Adnan AlSinand9c1d442023-10-06 19:07:48 +01003 *
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
25#ifndef ACL_SRC_DYNAMIC_FUSION_SKETCH_GPU_CKW_DRIVER_COMPONENTS_GPUCKWMATMUL_H
26#define ACL_SRC_DYNAMIC_FUSION_SKETCH_GPU_CKW_DRIVER_COMPONENTS_GPUCKWMATMUL_H
27
28#include "arm_compute/dynamic_fusion/sketch/attributes/MatMulAttributes.h"
29
30#include "src/core/common/Macros.h"
31#include "src/dynamic_fusion/sketch/gpu/ckw_driver/IGpuCkwComponentDriver.h"
32#include "src/dynamic_fusion/sketch/gpu/components/cl/ClComponentMatMul.h"
Gunes Bayir2b9fa592024-01-17 16:07:03 +000033#include "src/dynamic_fusion/sketch/gpu/GpuKernelComponentGroup.h"
Adnan AlSinand9c1d442023-10-06 19:07:48 +010034
35namespace arm_compute
36{
37namespace experimental
38{
39namespace dynamic_fusion
40{
41class GpuCkwMatMul final : public IGpuCkwComponentDriver
42{
43public:
44 using Attributes = ClComponentMatMul::Attributes;
45 using Settings = ClComponentMatMul::Settings;
46
47public:
48 /** Constructor
49 *
50 * For supported configurations please refer to @ref ClComponentMatMul::validate()
51 *
52 * @param[in] id Component id
53 * @param[in] tensors Tensor arguments to the component
54 * @param[in] attributes Component attributes. Attributes are a set of parameters that define what a component does
55 * @param[in] settings Component settings. Settings are a set of parameters that influence the implementation of a component
56 */
57 GpuCkwMatMul(ComponentId id,
58 const ArgumentPack<ITensorInfo> &tensors,
59 const Attributes &attributes,
60 const Settings &settings);
61
62 ARM_COMPUTE_DISALLOW_COPY_ALLOW_MOVE(GpuCkwMatMul);
63
64 /** Destructor */
65 ~GpuCkwMatMul() override = default;
66
67 // Inherited methods overriden
68 virtual void write_component_code(const ComponentGroup &comp_group,
69 GpuCkwVariableTable &vtable,
70 GpuCkwScopedKernelWriter writer) const override;
71 Window get_window() const override;
72 std::string get_name(const ComponentGroup &comp_group) const override;
73
74private:
75 const ITensorInfo *_lhs;
76 const ITensorInfo *_rhs;
77 const ITensorInfo *_dst;
78
Gunes Bayir2b9fa592024-01-17 16:07:03 +000079 Attributes _attributes;
80 Settings _settings;
Adnan AlSinand9c1d442023-10-06 19:07:48 +010081};
82} // namespace dynamic_fusion
83} // namespace experimental
84} // namespace arm_compute
85
86#endif // ACL_SRC_DYNAMIC_FUSION_SKETCH_GPU_CKW_DRIVER_COMPONENTS_GPUCKWMATMUL_H