Return list of features in 'names' after remove any implied features and keep the origins. Parameters ---------- 'names': sequence sequence of CPU feature names in uppercase. Returns ------- list of CPU features sorted as
(self, names)
| 1403 | return names.union(self.feature_implies(names)) |
| 1404 | |
| 1405 | def feature_ahead(self, names): |
| 1406 | """ |
| 1407 | Return list of features in 'names' after remove any |
| 1408 | implied features and keep the origins. |
| 1409 | |
| 1410 | Parameters |
| 1411 | ---------- |
| 1412 | 'names': sequence |
| 1413 | sequence of CPU feature names in uppercase. |
| 1414 | |
| 1415 | Returns |
| 1416 | ------- |
| 1417 | list of CPU features sorted as-is 'names' |
| 1418 | |
| 1419 | Examples |
| 1420 | -------- |
| 1421 | >>> self.feature_ahead(["SSE2", "SSE3", "SSE41"]) |
| 1422 | ["SSE41"] |
| 1423 | # assume AVX2 and FMA3 implies each other and AVX2 |
| 1424 | # is the highest interest |
| 1425 | >>> self.feature_ahead(["SSE2", "SSE3", "SSE41", "AVX2", "FMA3"]) |
| 1426 | ["AVX2"] |
| 1427 | # assume AVX2 and FMA3 don't implies each other |
| 1428 | >>> self.feature_ahead(["SSE2", "SSE3", "SSE41", "AVX2", "FMA3"]) |
| 1429 | ["AVX2", "FMA3"] |
| 1430 | """ |
| 1431 | assert( |
| 1432 | not isinstance(names, str) |
| 1433 | and hasattr(names, '__iter__') |
| 1434 | ) |
| 1435 | implies = self.feature_implies(names, keep_origins=True) |
| 1436 | ahead = [n for n in names if n not in implies] |
| 1437 | if len(ahead) == 0: |
| 1438 | # return the highest interested feature |
| 1439 | # if all features imply each other |
| 1440 | ahead = self.feature_sorted(names, reverse=True)[:1] |
| 1441 | return ahead |
| 1442 | |
| 1443 | def feature_untied(self, names): |
| 1444 | """ |
no test coverage detected