Commit 5b18ec4
committed
Adopt runtime::FunctionRef in thread_parallel_interface.h and thread_parallel.h
This saves a *ton* of size by no longer requiring callers to create std::function.
Test Plan: bash test/build_optimized_size_test.sh && size test/size_test_all_optimized_ops
before:
```
ExecuTorch with no ops binary size, unstripped:
-rwxr-xr-x 1 swolchok staff 153928 Apr 24 13:11 cmake-out/test/size_test
ExecuTorch with portable ops binary size, unstripped:
-rwxr-xr-x 1 swolchok staff 2150960 Apr 24 13:11 cmake-out/test/size_test_all_ops
ExecuTorch with optimized ops binary size, unstripped:
-rwxr-xr-x 1 swolchok staff 11182136 Apr 24 13:11 cmake-out/test/size_test_all_optimized_ops
__TEXT __DATA __OBJC others dec hex
5341184 98304 0 4300800000 4306239488 100ac0000
```
after:
```
ExecuTorch with no ops binary size, unstripped:
-rwxr-xr-x 1 swolchok staff 153928 Apr 24 13:07 cmake-out/test/size_test
ExecuTorch with portable ops binary size, unstripped:
-rwxr-xr-x 1 swolchok staff 2150960 Apr 24 13:07 cmake-out/test/size_test_all_ops
ExecuTorch with optimized ops binary size, unstripped:
-rwxr-xr-x 1 swolchok staff 5927336 Apr 24 13:07 cmake-out/test/size_test_all_optimized_ops
__TEXT __DATA __OBJC others dec hex
4505600 98304 0 4296376320 4300980224 1005bc000
````
`__TEXT` size improvement is 835584 bytes, or 15%.
ghstack-source-id: 516b5a7
ghstack-comment-id: 2828755250
Pull-Request-resolved: #104421 parent 15680fe commit 5b18ec4
File tree
2 files changed
+3
-2
lines changed- extension/threadpool
- runtime/kernel
2 files changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
72 | | - | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
0 commit comments