same as 'feature_ahead()' but if both features implied each other and keep the highest interest. Parameters ---------- 'names': sequence sequence of CPU feature names in uppercase. Returns ------- list of CPU features sor
(self, names)
| 1441 | return ahead |
| 1442 | |
| 1443 | def feature_untied(self, names): |
| 1444 | """ |
| 1445 | same as 'feature_ahead()' but if both features implied each other |
| 1446 | and keep the highest interest. |
| 1447 | |
| 1448 | Parameters |
| 1449 | ---------- |
| 1450 | 'names': sequence |
| 1451 | sequence of CPU feature names in uppercase. |
| 1452 | |
| 1453 | Returns |
| 1454 | ------- |
| 1455 | list of CPU features sorted as-is 'names' |
| 1456 | |
| 1457 | Examples |
| 1458 | -------- |
| 1459 | >>> self.feature_untied(["SSE2", "SSE3", "SSE41"]) |
| 1460 | ["SSE2", "SSE3", "SSE41"] |
| 1461 | # assume AVX2 and FMA3 implies each other |
| 1462 | >>> self.feature_untied(["SSE2", "SSE3", "SSE41", "FMA3", "AVX2"]) |
| 1463 | ["SSE2", "SSE3", "SSE41", "AVX2"] |
| 1464 | """ |
| 1465 | assert( |
| 1466 | not isinstance(names, str) |
| 1467 | and hasattr(names, '__iter__') |
| 1468 | ) |
| 1469 | final = [] |
| 1470 | for n in names: |
| 1471 | implies = self.feature_implies(n) |
| 1472 | tied = [ |
| 1473 | nn for nn in final |
| 1474 | if nn in implies and n in self.feature_implies(nn) |
| 1475 | ] |
| 1476 | if tied: |
| 1477 | tied = self.feature_sorted(tied + [n]) |
| 1478 | if n not in tied[1:]: |
| 1479 | continue |
| 1480 | final.remove(tied[:1][0]) |
| 1481 | final.append(n) |
| 1482 | return final |
| 1483 | |
| 1484 | def feature_get_til(self, names, keyisfalse): |
| 1485 | """ |
no test coverage detected