Commit 49446f4
Inline the whole broadcast expression to avoid allocation (#30986)
* Inline the whole broadcast expression to avoid allocation
`map` has an inline limit of 16. To make sure that the whole broadcast
tree gets inlined properly, I added the `_inlined_map` function. I am not
sure if it is a good idea, but worth trying.
This PR solves the issue which I have mentioned in
2693778#issuecomment-461248258
```julia
julia> @allocated foo(tmp, uprev, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13,
k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25,
k26, k27, k28, k29, k30, k31, k32, k33, k34)
0
```
* Fix CI failure
* Stricter test (vectorization & no allocation for a 9-array bc)
* rm `_inlined_map`1 parent 4261ac8 commit 49446f4
2 files changed
+11
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
467 | | - | |
| 467 | + | |
| 468 | + | |
468 | 469 | | |
469 | 470 | | |
470 | 471 | | |
| |||
502 | 503 | | |
503 | 504 | | |
504 | 505 | | |
505 | | - | |
| 506 | + | |
506 | 507 | | |
507 | 508 | | |
508 | 509 | | |
| |||
911 | 912 | | |
912 | 913 | | |
913 | 914 | | |
914 | | - | |
| 915 | + | |
915 | 916 | | |
916 | 917 | | |
917 | 918 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
791 | 791 | | |
792 | 792 | | |
793 | 793 | | |
794 | | - | |
795 | | - | |
796 | | - | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
797 | 798 | | |
798 | 799 | | |
799 | | - | |
800 | | - | |
801 | | - | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
802 | 803 | | |
803 | 804 | | |
804 | 805 | | |
| |||
0 commit comments