Commit d56e0b8
committed
outline input validation in elementwise_util
This seems to improve code size. Comparing output of test/build_optimized_size_test.sh before/after this change:
(I've edited out the unchanged "no ops" test case.)
before:
```
ExecuTorch with portable ops binary size, unstripped:
-rwxr-xr-x 1 swolchok staff 2004816 Jun 26 14:02 cmake-out/test/size_test_all_ops
__TEXT __DATA __OBJC others dec hex
1441792 65536 0 4295524352 4297031680 1001f8000
ExecuTorch with optimized ops binary size, unstripped:
-rwxr-xr-x 1 swolchok staff 6746968 Jun 26 14:02 cmake-out/test/size_test_all_optimized_ops
__TEXT __DATA __OBJC others dec hex
4947968 65536 0 4296753152 4301766656 10067c000
```
after:
```
ExecuTorch with portable ops binary size, unstripped:
-rwxr-xr-x 1 swolchok staff 1989392 Jun 26 14:37 cmake-out/test/size_test_all_ops
__TEXT __DATA __OBJC others dec hex
1425408 65536 0 4295524352 4297015296 1001f4000
ExecuTorch with optimized ops binary size, unstripped:
-rwxr-xr-x 1 swolchok staff 6731784 Jun 26 14:37 cmake-out/test/size_test_all_optimized_ops
__TEXT __DATA __OBJC others dec hex
4931584 65536 0 4296753152 4301750272 100678000
```
for test/build_size_test.sh, we see a smaller improvment which is reflected in the file sizes but not the `size` command output, probably because the latter is rounded up to the next page:
before:
```
ExecuTorch with portable ops binary size, unstripped:
-rwxr-xr-x 1 swolchok staff 2696640 Jun 26 13:44 cmake-out/test/size_test_all_ops
__TEXT __DATA __OBJC others dec hex
2162688 65536 0 4295491584 4297719808 1002a0000
```
after:
```
ExecuTorch with portable ops binary size, unstripped:
-rwxr-xr-x 1 swolchok staff 2695344 Jun 26 14:33 cmake-out/test/size_test_all_ops
__TEXT __DATA __OBJC others dec hex
2162688 65536 0 4295491584 4297719808 1002a0000
```
ghstack-source-id: 6ac1c77
ghstack-comment-id: 3010230941
Pull-Request-resolved: #120311 parent f6624dc commit d56e0b8
File tree
3 files changed
+114
-25
lines changed- kernels/portable/cpu/util
3 files changed
+114
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
224 | | - | |
225 | | - | |
| 223 | + | |
226 | 224 | | |
227 | 225 | | |
228 | 226 | | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
| 227 | + | |
| 228 | + | |
244 | 229 | | |
245 | | - | |
246 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
247 | 246 | | |
248 | 247 | | |
249 | 248 | | |
| |||
314 | 313 | | |
315 | 314 | | |
316 | 315 | | |
317 | | - | |
318 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
343 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
344 | 345 | | |
345 | 346 | | |
346 | 347 | | |
347 | 348 | | |
348 | | - | |
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
107 | 110 | | |
108 | 111 | | |
109 | 112 | | |
| |||
0 commit comments