diff options
author | Gian Marco Iodice <gianmarco.iodice@arm.com> | 2020-04-15 11:42:15 +0100 |
---|---|---|
committer | Gian Marco Iodice <gianmarco.iodice@arm.com> | 2020-04-20 13:04:42 +0000 |
commit | eb65f6da695ac0d3e495817145cceb1c4de4f048 (patch) | |
tree | 1e4980ba6d6ce2d738670c2ebadf4e24ebd172ce /arm_compute/core/CL/gemm/native | |
parent | 47a899017e67556ffffef78571c9be61dd7bc3f0 (diff) | |
download | ComputeLibrary-eb65f6da695ac0d3e495817145cceb1c4de4f048.tar.gz |
COMPMID-3304: Update OpenCL GEMM heuristic for Int8
Change-Id: I6b7ff678d8d0437a1639db2ff602ea1cdb155464
Signed-off-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3056
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core/CL/gemm/native')
4 files changed, 53 insertions, 18 deletions
diff --git a/arm_compute/core/CL/gemm/native/CLGEMMNativeKernelConfiguration.h b/arm_compute/core/CL/gemm/native/CLGEMMNativeKernelConfiguration.h index fced41b261..a6341e5094 100644 --- a/arm_compute/core/CL/gemm/native/CLGEMMNativeKernelConfiguration.h +++ b/arm_compute/core/CL/gemm/native/CLGEMMNativeKernelConfiguration.h @@ -26,6 +26,7 @@ #include "arm_compute/core/CL/ICLGEMMKernelConfiguration.h" #include "arm_compute/core/CL/gemm/native/CLGEMMNativeKernelConfigurationBifrost.h" +#include "arm_compute/core/CL/gemm/native/CLGEMMNativeKernelConfigurationMidgard.h" #include "arm_compute/core/CL/gemm/native/CLGEMMNativeKernelConfigurationValhall.h" #include <memory> @@ -49,12 +50,11 @@ public: switch(get_arch_from_target(gpu)) { case GPUTarget::MIDGARD: + return support::cpp14::make_unique<CLGEMMNativeKernelConfigurationMidgard>(gpu); case GPUTarget::BIFROST: return support::cpp14::make_unique<CLGEMMNativeKernelConfigurationBifrost>(gpu); - break; case GPUTarget::VALHALL: return support::cpp14::make_unique<CLGEMMNativeKernelConfigurationValhall>(gpu); - break; default: ARM_COMPUTE_ERROR("Not supported GPU target"); } diff --git a/arm_compute/core/CL/gemm/native/CLGEMMNativeKernelConfigurationBifrost.h b/arm_compute/core/CL/gemm/native/CLGEMMNativeKernelConfigurationBifrost.h index 29b8e08a80..5b2abe6f0f 100644 --- a/arm_compute/core/CL/gemm/native/CLGEMMNativeKernelConfigurationBifrost.h +++ b/arm_compute/core/CL/gemm/native/CLGEMMNativeKernelConfigurationBifrost.h @@ -39,14 +39,6 @@ public: * @param[in] gpu GPU target */ CLGEMMNativeKernelConfigurationBifrost(GPUTarget gpu); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLGEMMNativeKernelConfigurationBifrost(const CLGEMMNativeKernelConfigurationBifrost &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLGEMMNativeKernelConfigurationBifrost &operator=(const CLGEMMNativeKernelConfigurationBifrost &) = delete; - /** Default Move Constructor. */ - CLGEMMNativeKernelConfigurationBifrost(CLGEMMNativeKernelConfigurationBifrost &&) = default; - /** Default move assignment operator */ - CLGEMMNativeKernelConfigurationBifrost &operator=(CLGEMMNativeKernelConfigurationBifrost &&) = default; // Inherited overridden method std::pair<GEMMLHSMatrixInfo, GEMMRHSMatrixInfo> configure(unsigned int m, unsigned int n, unsigned int k, unsigned int b, DataType data_type) override; diff --git a/arm_compute/core/CL/gemm/native/CLGEMMNativeKernelConfigurationMidgard.h b/arm_compute/core/CL/gemm/native/CLGEMMNativeKernelConfigurationMidgard.h new file mode 100644 index 0000000000..0e95a15613 --- /dev/null +++ b/arm_compute/core/CL/gemm/native/CLGEMMNativeKernelConfigurationMidgard.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2020 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_CLGEMMNATIVEKERNELCONFIGURATIONMIDGARD_H +#define ARM_COMPUTE_CLGEMMNATIVEKERNELCONFIGURATIONMIDGARD_H + +#include "arm_compute/core/CL/ICLGEMMKernelConfiguration.h" + +namespace arm_compute +{ +namespace cl_gemm +{ +/** Midgard based OpenCL GEMMNative configuration */ +class CLGEMMNativeKernelConfigurationMidgard final : public ICLGEMMKernelConfiguration +{ +public: + /** Constructor + * + * @param[in] gpu GPU target + */ + CLGEMMNativeKernelConfigurationMidgard(GPUTarget gpu); + + // Inherited overridden method + std::pair<GEMMLHSMatrixInfo, GEMMRHSMatrixInfo> configure(unsigned int m, unsigned int n, unsigned int k, unsigned int b, DataType data_type) override; + +private: + std::pair<GEMMLHSMatrixInfo, GEMMRHSMatrixInfo> default_q8(unsigned int m, unsigned int n, unsigned int k, unsigned int b); +}; +} // namespace cl_gemm +} // namespace arm_compute +#endif /*ARM_COMPUTE_CLGEMMNATIVEKERNELCONFIGURATIONMIDGARD_H */ diff --git a/arm_compute/core/CL/gemm/native/CLGEMMNativeKernelConfigurationValhall.h b/arm_compute/core/CL/gemm/native/CLGEMMNativeKernelConfigurationValhall.h index f6a61a24b8..e739997b3a 100644 --- a/arm_compute/core/CL/gemm/native/CLGEMMNativeKernelConfigurationValhall.h +++ b/arm_compute/core/CL/gemm/native/CLGEMMNativeKernelConfigurationValhall.h @@ -39,14 +39,6 @@ public: * @param[in] gpu GPU target */ CLGEMMNativeKernelConfigurationValhall(GPUTarget gpu); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLGEMMNativeKernelConfigurationValhall(const CLGEMMNativeKernelConfigurationValhall &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLGEMMNativeKernelConfigurationValhall &operator=(const CLGEMMNativeKernelConfigurationValhall &) = delete; - /** Default Move Constructor. */ - CLGEMMNativeKernelConfigurationValhall(CLGEMMNativeKernelConfigurationValhall &&) = default; - /** Default move assignment operator */ - CLGEMMNativeKernelConfigurationValhall &operator=(CLGEMMNativeKernelConfigurationValhall &&) = default; // Inherited overridden method std::pair<GEMMLHSMatrixInfo, GEMMRHSMatrixInfo> configure(unsigned int m, unsigned int n, unsigned int k, unsigned int b, DataType data_type) override; |