Adnan AlSinan | d9c1d44 | 2023-10-06 19:07:48 +0100 | [diff] [blame] | 1 | /* |
Gunes Bayir | 2b9fa59 | 2024-01-17 16:07:03 +0000 | [diff] [blame^] | 2 | * Copyright (c) 2023-2024 Arm Limited. |
Adnan AlSinan | d9c1d44 | 2023-10-06 19:07:48 +0100 | [diff] [blame] | 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 | |
| 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 Bayir | 2b9fa59 | 2024-01-17 16:07:03 +0000 | [diff] [blame^] | 33 | #include "src/dynamic_fusion/sketch/gpu/GpuKernelComponentGroup.h" |
Adnan AlSinan | d9c1d44 | 2023-10-06 19:07:48 +0100 | [diff] [blame] | 34 | |
| 35 | namespace arm_compute |
| 36 | { |
| 37 | namespace experimental |
| 38 | { |
| 39 | namespace dynamic_fusion |
| 40 | { |
| 41 | class GpuCkwMatMul final : public IGpuCkwComponentDriver |
| 42 | { |
| 43 | public: |
| 44 | using Attributes = ClComponentMatMul::Attributes; |
| 45 | using Settings = ClComponentMatMul::Settings; |
| 46 | |
| 47 | public: |
| 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 | |
| 74 | private: |
| 75 | const ITensorInfo *_lhs; |
| 76 | const ITensorInfo *_rhs; |
| 77 | const ITensorInfo *_dst; |
| 78 | |
Gunes Bayir | 2b9fa59 | 2024-01-17 16:07:03 +0000 | [diff] [blame^] | 79 | Attributes _attributes; |
| 80 | Settings _settings; |
Adnan AlSinan | d9c1d44 | 2023-10-06 19:07:48 +0100 | [diff] [blame] | 81 | }; |
| 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 |