MCPcopy Create free account
hub / github.com/numpy/numpy / get_cpuinfo_item

Method get_cpuinfo_item

numpy/core/tests/test_cpu_features.py:96–105  ·  view source on GitHub ↗
(self, magic_key)

Source from the content-addressed store, hash-verified

94 self.features_flags = self.get_cpuinfo_item(magic_key)
95
96 def get_cpuinfo_item(self, magic_key):
97 values = set()
98 with open('/proc/cpuinfo') as fd:
99 for line in fd:
100 if not line.startswith(magic_key):
101 continue
102 flags_value = [s.strip() for s in line.split(':', 1)]
103 if len(flags_value) == 2:
104 values = values.union(flags_value[1].upper().split())
105 return values
106
107 def load_flags_auxv(self):
108 auxv = subprocess.check_output(['/bin/true'], env=dict(LD_SHOW_AUXV="1"))

Callers 2

load_flags_cpuinfoMethod · 0.95
load_flagsMethod · 0.80

Calls 5

openFunction · 0.85
startswithMethod · 0.80
stripMethod · 0.80
upperMethod · 0.80
splitMethod · 0.45

Tested by

no test coverage detected