Compute Library
 21.11
CPUInfo Class Referencefinal

#include <CPPTypes.h>

Public Member Functions

 CPUInfo (CPUInfo const &)=delete
 
 CPUInfo (CPUInfo &&)=delete
 
CPUInfooperator= (CPUInfo const &)=delete
 
CPUInfooperator= (CPUInfo &&)=delete
 
bool has_fp16 () const
 Checks if the cpu model supports fp16. More...
 
bool has_bf16 () const
 Checks if the cpu model supports bf16. More...
 
bool has_svebf16 () const
 Checks if the cpu model supports bf16. More...
 
bool has_dotprod () const
 Checks if the cpu model supports dot product. More...
 
bool has_svef32mm () const
 Checks if the cpu model supports floating-point matrix multiplication. More...
 
bool has_i8mm () const
 Checks if the cpu model supports integer matrix multiplication. More...
 
bool has_svei8mm () const
 Checks if the cpu model supports integer matrix multiplication. More...
 
bool has_sve () const
 Checks if the cpu model supports sve. More...
 
bool has_sve2 () const
 Checks if the cpu model supports sve2. More...
 
CPUModel get_cpu_model (unsigned int cpuid) const
 Gets the cpu model for a given cpuid. More...
 
CPUModel get_cpu_model () const
 Gets the current thread's cpu model. More...
 
unsigned int get_L1_cache_size () const
 Gets the L1 cache size. More...
 
unsigned int get_L2_cache_size () const
 Gets the L2 cache size. More...
 
unsigned int get_cpu_num () const
 Return the maximum number of CPUs present. More...
 

Static Public Member Functions

static CPUInfoget ()
 Access the KernelLibrary singleton. More...
 

Detailed Description

Definition at line 59 of file CPPTypes.h.

Constructor & Destructor Documentation

◆ CPUInfo() [1/2]

CPUInfo ( CPUInfo const &  )
delete

◆ CPUInfo() [2/2]

CPUInfo ( CPUInfo &&  )
delete

Member Function Documentation

◆ get()

CPUInfo & get ( )
static

Access the KernelLibrary singleton.

This method has been deprecated and will be removed in future releases

Returns
The KernelLibrary instance.

Definition at line 39 of file CPPTypes.cpp.

References CpuInfo::build().

Referenced by CpuLogits1DMaxKernel::configure(), CpuActivationKernel::configure(), CpuScaleKernel::configure(), CpuAddKernel::configure(), CpuDirectConv3dKernel::configure(), CpuLogits1DSoftmaxKernel< IS_LOG >::configure(), IScheduler::cpu_info(), arm_compute::error_on_unsupported_cpu_bf16(), arm_compute::error_on_unsupported_cpu_fp16(), and NEBatchNormalizationLayerKernel::run().

40 {
41  static CPUInfo _cpuinfo;
42  return _cpuinfo;
43 }

◆ get_cpu_model() [1/2]

CPUModel get_cpu_model ( unsigned int  cpuid) const

Gets the cpu model for a given cpuid.

Parameters
[in]cpuidthe id of the cpu core to be retrieved,
Returns
the CPUModel of the cpuid queiried.

Definition at line 108 of file CPPTypes.cpp.

Referenced by CpuConv2d::get_convolution_method(), and main().

109 {
110  return _impl->info.cpu_model(cpuid);
111 }

◆ get_cpu_model() [2/2]

CPUModel get_cpu_model ( ) const

Gets the current thread's cpu model.

Returns
Current thread's CPUModel

Definition at line 103 of file CPPTypes.cpp.

104 {
105  return _impl->info.cpu_model();
106 }

◆ get_cpu_num()

unsigned int get_cpu_num ( ) const

Return the maximum number of CPUs present.

Returns
Number of CPUs

Definition at line 53 of file CPPTypes.cpp.

Referenced by main().

54 {
55  return _impl->info.num_cpus();
56 }

◆ get_L1_cache_size()

unsigned int get_L1_cache_size ( ) const

Gets the L1 cache size.

Returns
the size of the L1 cache

Definition at line 113 of file CPPTypes.cpp.

114 {
115  return _impl->L1_cache_size;
116 }

◆ get_L2_cache_size()

unsigned int get_L2_cache_size ( ) const

Gets the L2 cache size.

Returns
the size of the L1 cache

Definition at line 118 of file CPPTypes.cpp.

Referenced by GemmInterleavedPretransposed2d< strategy, To, Tr >::GemmInterleavedPretransposed2d().

119 {
120  return _impl->L2_cache_size;
121 }

◆ has_bf16()

bool has_bf16 ( ) const

Checks if the cpu model supports bf16.

Returns
true of the cpu supports bf16, false otherwise

Definition at line 63 of file CPPTypes.cpp.

Referenced by arm_compute::error_on_unsupported_cpu_bf16(), and main().

64 {
65  return _impl->info.has_bf16();
66 }

◆ has_dotprod()

bool has_dotprod ( ) const

Checks if the cpu model supports dot product.

Returns
true of the cpu supports dot product, false otherwise

Definition at line 73 of file CPPTypes.cpp.

Referenced by main().

74 {
75  return _impl->info.has_dotprod();
76 }

◆ has_fp16()

bool has_fp16 ( ) const

Checks if the cpu model supports fp16.

Returns
true of the cpu supports fp16, false otherwise

Definition at line 58 of file CPPTypes.cpp.

Referenced by arm_compute::error_on_unsupported_cpu_fp16(), and main().

59 {
60  return _impl->info.has_fp16();
61 }

◆ has_i8mm()

bool has_i8mm ( ) const

Checks if the cpu model supports integer matrix multiplication.

Returns
true of the cpu supports integer matrix multiplication, false otherwise

Definition at line 83 of file CPPTypes.cpp.

84 {
85  return _impl->info.has_i8mm();
86 }

◆ has_sve()

bool has_sve ( ) const

Checks if the cpu model supports sve.

Returns
true of the cpu supports sve, false otherwise

Definition at line 93 of file CPPTypes.cpp.

Referenced by main().

94 {
95  return _impl->info.has_sve();
96 }

◆ has_sve2()

bool has_sve2 ( ) const

Checks if the cpu model supports sve2.

Returns
true of the cpu supports sve2, false otherwise

Definition at line 98 of file CPPTypes.cpp.

99 {
100  return _impl->info.has_sve2();
101 }

◆ has_svebf16()

bool has_svebf16 ( ) const

Checks if the cpu model supports bf16.

Returns
true of the cpu supports bf16, false otherwise

Definition at line 68 of file CPPTypes.cpp.

69 {
70  return _impl->info.has_svebf16();
71 }

◆ has_svef32mm()

bool has_svef32mm ( ) const

Checks if the cpu model supports floating-point matrix multiplication.

Returns
true of the cpu supports floating-point matrix multiplication, false otherwise

Definition at line 78 of file CPPTypes.cpp.

79 {
80  return _impl->info.has_svef32mm();
81 }

◆ has_svei8mm()

bool has_svei8mm ( ) const

Checks if the cpu model supports integer matrix multiplication.

Returns
true of the cpu supports integer matrix multiplication, false otherwise

Definition at line 88 of file CPPTypes.cpp.

89 {
90  return _impl->info.has_svei8mm();
91 }

◆ operator=() [1/2]

CPUInfo& operator= ( CPUInfo const &  )
delete

◆ operator=() [2/2]

CPUInfo& operator= ( CPUInfo &&  )
delete

The documentation for this class was generated from the following files: