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

Method feature_is_supported

numpy/distutils/ccompiler_opt.py:1580–1606  ·  view source on GitHub ↗

Check if a certain CPU feature is supported by the platform and compiler. Parameters ---------- name : str CPU feature name in uppercase. force_flags : list or None, optional If None(default), default compiler flags for every CPU fea

(self, name, force_flags=None, macros=[])

Source from the content-addressed store, hash-verified

1578
1579 @_Cache.me
1580 def feature_is_supported(self, name, force_flags=None, macros=[]):
1581 """
1582 Check if a certain CPU feature is supported by the platform and compiler.
1583
1584 Parameters
1585 ----------
1586 name : str
1587 CPU feature name in uppercase.
1588
1589 force_flags : list or None, optional
1590 If None(default), default compiler flags for every CPU feature will
1591 be used during test.
1592
1593 macros : list of tuples, optional
1594 A list of C macro definitions.
1595 """
1596 assert(name.isupper())
1597 assert(force_flags is None or isinstance(force_flags, list))
1598
1599 supported = name in self.feature_supported
1600 if supported:
1601 for impl in self.feature_implies(name):
1602 if not self.feature_test(impl, force_flags, macros=macros):
1603 return False
1604 if not self.feature_test(name, force_flags, macros=macros):
1605 return False
1606 return supported
1607
1608 @_Cache.me
1609 def feature_can_autovec(self, name):

Callers 1

feature_namesMethod · 0.95

Calls 3

feature_impliesMethod · 0.95
feature_testMethod · 0.95
isupperMethod · 0.80

Tested by

no test coverage detected