Commit fc4e54a
authored
Resolve internal issue #557: bugs in eWiseApply (#105)
The `grb::eWiseApply` had several issues:
1. all variants did not check properly for `ILLEGAL` arguments in the presence of the dense descriptor;
2. in one variant (`vector<-scalar<-vector, operator`) performed an in-place update while the primitive should be out-of-place;
3. the implementation variant that is driven by the nonzero pattern of the mask, in the non-vectorised coda of its implementation, did not check whether both input vectors had an element assigned;
4. in the vector-driven sparse variant and for monoids, conditions could arise where nonzeroes in the output vector may be skipped, while their values would be correctly recorded.
These issues triggered rarely (as in no known "natural" occurrence), and are all fixed in this MR.
This MR also
- includes some minor code style fixes throughout the files touched;
- updates the dispatch-to-inplace detection methods used within `eWiseApply` to use `getID` instead of pointer-based logic;
- removes some optimisations for cases that would never occur (now also asserted as such);
- handles trivial operations on empty vectors faster.
Thanks to Aristeidis for detecting issues 2-4!1 parent 4485bdb commit fc4e54a
3 files changed
Lines changed: 206 additions & 100 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1477 | 1477 | | |
1478 | 1478 | | |
1479 | 1479 | | |
1480 | | - | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
1481 | 1483 | | |
1482 | 1484 | | |
1483 | 1485 | | |
| |||
1488 | 1490 | | |
1489 | 1491 | | |
1490 | 1492 | | |
1491 | | - | |
| 1493 | + | |
1492 | 1494 | | |
1493 | 1495 | | |
1494 | 1496 | | |
| |||
1566 | 1568 | | |
1567 | 1569 | | |
1568 | 1570 | | |
1569 | | - | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
1570 | 1574 | | |
1571 | 1575 | | |
1572 | 1576 | | |
| |||
1577 | 1581 | | |
1578 | 1582 | | |
1579 | 1583 | | |
1580 | | - | |
| 1584 | + | |
1581 | 1585 | | |
1582 | 1586 | | |
1583 | 1587 | | |
| |||
1657 | 1661 | | |
1658 | 1662 | | |
1659 | 1663 | | |
1660 | | - | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
1661 | 1667 | | |
1662 | 1668 | | |
1663 | 1669 | | |
| |||
1773 | 1779 | | |
1774 | 1780 | | |
1775 | 1781 | | |
1776 | | - | |
| 1782 | + | |
1777 | 1783 | | |
1778 | 1784 | | |
1779 | 1785 | | |
| |||
1879 | 1885 | | |
1880 | 1886 | | |
1881 | 1887 | | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
1882 | 1891 | | |
1883 | 1892 | | |
1884 | 1893 | | |
| |||
1979 | 1988 | | |
1980 | 1989 | | |
1981 | 1990 | | |
1982 | | - | |
| 1991 | + | |
1983 | 1992 | | |
1984 | 1993 | | |
1985 | 1994 | | |
| |||
2499 | 2508 | | |
2500 | 2509 | | |
2501 | 2510 | | |
2502 | | - | |
| 2511 | + | |
2503 | 2512 | | |
2504 | 2513 | | |
2505 | 2514 | | |
| |||
2563 | 2572 | | |
2564 | 2573 | | |
2565 | 2574 | | |
2566 | | - | |
| 2575 | + | |
2567 | 2576 | | |
2568 | 2577 | | |
2569 | 2578 | | |
| |||
2624 | 2633 | | |
2625 | 2634 | | |
2626 | 2635 | | |
2627 | | - | |
| 2636 | + | |
2628 | 2637 | | |
2629 | 2638 | | |
2630 | 2639 | | |
| |||
0 commit comments