Commit 078493e
committed
Changed simplify_iteration_two_strides, simplify_iteration_three_strides
The target ordering used to be based on absolute values of the first
vector of strides, now it uses lexicographic ordering of tuples of
absolute values of all strides involved.
This enables iteration space reduction for examples where all strides
in the first vector are all zero, like in the example arising from
```
dpctl.tensor.full((2,3,4,), dpctl.tensor.asarray(1))
```
The following two invocations show that iteration space used is 1d:
```
onetrace -d -v --demangle python -c "import dpctl.tensor as dpt; x = dpt.ones((30, 40, 50), dtype='i4'); y = dpt.empty_like(x, dtype='f4'); print((x.flags, y.flags)); y[:] = x"
onetrace -d -v --demangle python -c "import dpctl.tensor._tensor_impl as ti, dpctl.tensor as dpt; dpt.full((2,3,4), dpt.asarray(1, dtype='f4'))"
```1 parent 1c9dc56 commit 078493e
1 file changed
+36
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
436 | 444 | | |
437 | 445 | | |
438 | 446 | | |
| |||
458 | 466 | | |
459 | 467 | | |
460 | 468 | | |
| 469 | + | |
461 | 470 | | |
462 | 471 | | |
463 | 472 | | |
| |||
570 | 579 | | |
571 | 580 | | |
572 | 581 | | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
580 | 604 | | |
581 | 605 | | |
582 | 606 | | |
| |||
0 commit comments