diff options
Diffstat (limited to 'src/core/CPP/CPPTypes.cpp')
-rw-r--r-- | src/core/CPP/CPPTypes.cpp | 63 |
1 files changed, 55 insertions, 8 deletions
diff --git a/src/core/CPP/CPPTypes.cpp b/src/core/CPP/CPPTypes.cpp index edcb9cb1ba..9980db42f3 100644 --- a/src/core/CPP/CPPTypes.cpp +++ b/src/core/CPP/CPPTypes.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2021 Arm Limited. + * Copyright (c) 2018-2022 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -25,7 +25,9 @@ #include "arm_compute/core/CPP/CPPTypes.h" #include "arm_compute/core/Error.h" + #include "src/common/cpuinfo/CpuInfo.h" +#include "src/common/cpuinfo/CpuIsaInfo.h" namespace arm_compute { @@ -36,8 +38,13 @@ struct CPUInfo::Impl unsigned int L2_cache_size = 262144; }; -CPUInfo::CPUInfo() - : _impl(std::make_unique<Impl>()) +CPUInfo &CPUInfo::get() +{ + static CPUInfo _cpuinfo; + return _cpuinfo; +} + +CPUInfo::CPUInfo() : _impl(std::make_unique<Impl>()) { _impl->info = cpuinfo::CpuInfo::build(); } @@ -49,11 +56,6 @@ unsigned int CPUInfo::get_cpu_num() const return _impl->info.num_cpus(); } -bool CPUInfo::has_sve() const -{ - return _impl->info.has_sve(); -} - bool CPUInfo::has_fp16() const { return _impl->info.has_fp16(); @@ -64,11 +66,51 @@ bool CPUInfo::has_bf16() const return _impl->info.has_bf16(); } +bool CPUInfo::has_svebf16() const +{ + return _impl->info.has_svebf16(); +} + bool CPUInfo::has_dotprod() const { return _impl->info.has_dotprod(); } +bool CPUInfo::has_svef32mm() const +{ + return _impl->info.has_svef32mm(); +} + +bool CPUInfo::has_i8mm() const +{ + return _impl->info.has_i8mm(); +} + +bool CPUInfo::has_svei8mm() const +{ + return _impl->info.has_svei8mm(); +} + +bool CPUInfo::has_sve() const +{ + return _impl->info.has_sve(); +} + +bool CPUInfo::has_sve2() const +{ + return _impl->info.has_sve2(); +} + +bool CPUInfo::has_sme() const +{ + return _impl->info.has_sme(); +} + +bool CPUInfo::has_sme2() const +{ + return _impl->info.has_sme2(); +} + CPUModel CPUInfo::get_cpu_model() const { return _impl->info.cpu_model(); @@ -79,6 +121,11 @@ CPUModel CPUInfo::get_cpu_model(unsigned int cpuid) const return _impl->info.cpu_model(cpuid); } +cpuinfo::CpuIsaInfo CPUInfo::get_isa() const +{ + return _impl->info.isa(); +} + unsigned int CPUInfo::get_L1_cache_size() const { return _impl->L1_cache_size; |