blob: 1503e74eb6b63ddd5c8959d68e7aef52174de3a4 [file] [log] [blame]
Gian Marco Iodice90313eb2019-01-16 15:40:25 +00001/*
Georgios Pinitas856f66e2021-04-22 21:13:21 +01002 * Copyright (c) 2019-2021 Arm Limited.
Gian Marco Iodice90313eb2019-01-16 15:40:25 +00003 *
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 */
Georgios Pinitas856f66e2021-04-22 21:13:21 +010024#ifndef ARM_COMPUTE_CL_GEMM_RESHAPED_ONLY_RHS_KERNEL_CONFIGURATION_H
25#define ARM_COMPUTE_CL_GEMM_RESHAPED_ONLY_RHS_KERNEL_CONFIGURATION_H
Gian Marco Iodice90313eb2019-01-16 15:40:25 +000026
Georgios Pinitas7891a732021-08-20 21:39:25 +010027#include "src/gpu/cl/kernels/gemm/IClGemmKernelConfig.h"
28#include "src/gpu/cl/kernels/gemm/reshaped_only_rhs/ClGemmDefaultConfigReshapedRhsOnlyBifrost.h"
29#include "src/gpu/cl/kernels/gemm/reshaped_only_rhs/ClGemmDefaultConfigReshapedRhsOnlyValhall.h"
Gian Marco Iodice90313eb2019-01-16 15:40:25 +000030
Georgios Pinitas40f51a62020-11-21 03:04:18 +000031#include <memory>
Gian Marco Iodice90313eb2019-01-16 15:40:25 +000032
33namespace arm_compute
34{
Georgios Pinitas856f66e2021-04-22 21:13:21 +010035namespace opencl
36{
37namespace kernels
38{
39namespace gemm
Gian Marco Iodice90313eb2019-01-16 15:40:25 +000040{
Gian Marco Iodice926afe12019-03-19 11:44:13 +000041/** CLGEMMReshapedOnlyRHS factory class */
Georgios Pinitas856f66e2021-04-22 21:13:21 +010042class ClGemmReshapedOnlyRhsKernelConfigurationFactory final
Gian Marco Iodice90313eb2019-01-16 15:40:25 +000043{
44public:
Gian Marco Iodice12f2b8c2020-02-13 12:27:37 +000045 /** Static method to call the CLGEMMReshapedOnlyRHS kernel configuration class accordingly with the GPU target
Gian Marco Iodice926afe12019-03-19 11:44:13 +000046 *
Gian Marco Iodice12f2b8c2020-02-13 12:27:37 +000047 * @param[in] gpu GPU target
Gian Marco Iodice926afe12019-03-19 11:44:13 +000048 *
49 * @return CLGEMMReshapedOnlyRHS kernel configuration class
50 */
Georgios Pinitas856f66e2021-04-22 21:13:21 +010051 static std::unique_ptr<IClGemmKernelConfig> create(GPUTarget gpu)
Gian Marco Iodice90313eb2019-01-16 15:40:25 +000052 {
Gian Marco Iodice12f2b8c2020-02-13 12:27:37 +000053 switch(get_arch_from_target(gpu))
54 {
55 case GPUTarget::MIDGARD:
56 case GPUTarget::BIFROST:
Georgios Pinitas856f66e2021-04-22 21:13:21 +010057 return std::make_unique<ClGemmDefaultConfigReshapedRhsOnlyBifrost>(gpu);
Gian Marco Iodice12f2b8c2020-02-13 12:27:37 +000058 case GPUTarget::VALHALL:
Georgios Pinitas856f66e2021-04-22 21:13:21 +010059 return std::make_unique<ClGemmDefaultConfigReshapedRhsOnlyValhall>(gpu);
Gian Marco Iodice12f2b8c2020-02-13 12:27:37 +000060 default:
61 ARM_COMPUTE_ERROR("Not supported GPU target");
62 }
Gian Marco Iodice90313eb2019-01-16 15:40:25 +000063 }
64};
Georgios Pinitas856f66e2021-04-22 21:13:21 +010065} // namespace gemm
66} // namespace kernels
67} // namespace opencl
Gian Marco Iodice90313eb2019-01-16 15:40:25 +000068} // namespace arm_compute
Georgios Pinitas856f66e2021-04-22 21:13:21 +010069#endif /* ARM_COMPUTE_CL_GEMM_RESHAPED_ONLY_RHS_KERNEL_CONFIGURATION_H */