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

Method load_flags

numpy/core/tests/test_cpu_features.py:389–404  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

387 NEON_VFPV4 = ["NEON", "VFPV4"],
388 )
389 def load_flags(self):
390 self.load_flags_cpuinfo("Features")
391 arch = self.get_cpuinfo_item("CPU architecture")
392 # in case of mounting virtual filesystem of aarch64 kernel
393 is_rootfs_v8 = int('0'+next(iter(arch))) > 7 if arch else 0
394 if re.match("^(aarch64|AARCH64)", machine) or is_rootfs_v8:
395 self.features_map = dict(
396 NEON="ASIMD", HALF="ASIMD", VFPV4="ASIMD"
397 )
398 else:
399 self.features_map = dict(
400 # ELF auxiliary vector and /proc/cpuinfo on Linux kernel(armv8 aarch32)
401 # doesn't provide information about ASIMD, so we assume that ASIMD is supported
402 # if the kernel reports any one of the following ARM8 features.
403 ASIMD=("AES", "SHA1", "SHA2", "PMULL", "CRC32")
404 )

Callers

nothing calls this directly

Calls 3

load_flags_cpuinfoMethod · 0.80
get_cpuinfo_itemMethod · 0.80
nextFunction · 0.50

Tested by

no test coverage detected