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

Method feature_sorted

numpy/distutils/ccompiler_opt.py:1322–1346  ·  view source on GitHub ↗

Sort a list of CPU features ordered by the lowest interest. Parameters ---------- 'names': sequence sequence of supported feature names in uppercase. 'reverse': bool, optional If true, the sorted features is reversed. (highest interes

(self, names, reverse=False)

Source from the content-addressed store, hash-verified

1320 return name in self.conf_features
1321
1322 def feature_sorted(self, names, reverse=False):
1323 """
1324 Sort a list of CPU features ordered by the lowest interest.
1325
1326 Parameters
1327 ----------
1328 'names': sequence
1329 sequence of supported feature names in uppercase.
1330 'reverse': bool, optional
1331 If true, the sorted features is reversed. (highest interest)
1332
1333 Returns
1334 -------
1335 list, sorted CPU features
1336 """
1337 def sort_cb(k):
1338 if isinstance(k, str):
1339 return self.feature_supported[k]["interest"]
1340 # multiple features
1341 rank = max([self.feature_supported[f]["interest"] for f in k])
1342 # FIXME: that's not a safe way to increase the rank for
1343 # multi targets
1344 rank += len(k) -1
1345 return rank
1346 return sorted(names, reverse=reverse, key=sort_cb)
1347
1348 def feature_implies(self, names, keep_origins=False):
1349 """

Callers 11

feature_aheadMethod · 0.95
feature_untiedMethod · 0.95
tilMethod · 0.95
feature_get_tilMethod · 0.95
feature_flagsMethod · 0.95
serializeMethod · 0.80
__init__Method · 0.80
_parse_multi_targetMethod · 0.80
reportMethod · 0.80
_wrap_targetMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected