MCPcopy Create free account
hub / github.com/pydata/numexpr / get_info

Method get_info

numexpr3/cpuinfo.py:731–754  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

729
730 # http://en.wikipedia.org/wiki/CPUID#EAX.3D1:_Processor_Info_and_Feature_Bits
731 def get_info(self):
732 # EAX
733 eax = self._run_asm(
734 self._one_eax(),
735 b"\x0f\xa2" # cpuid
736 b"\xC3" # ret
737 )
738
739 # Get the CPU info
740 stepping = (eax >> 0) & 0xF # 4 bits
741 model = (eax >> 4) & 0xF # 4 bits
742 family = (eax >> 8) & 0xF # 4 bits
743 processor_type = (eax >> 12) & 0x3 # 2 bits
744 extended_model = (eax >> 16) & 0xF # 4 bits
745 extended_family = (eax >> 20) & 0xFF # 8 bits
746
747 return {
748 'stepping' : stepping,
749 'model' : model,
750 'family' : family,
751 'processor_type' : processor_type,
752 'extended_model' : extended_model,
753 'extended_family' : extended_family
754 }
755
756 # http://en.wikipedia.org/wiki/CPUID#EAX.3D80000000h:_Get_Highest_Extended_Function_Supported
757 def get_max_extension_support(self):

Callers 1

Calls 2

_run_asmMethod · 0.95
_one_eaxMethod · 0.95

Tested by

no test coverage detected