Commit fb4056c
Allow operators to be called outside of the kernel registry
Summary:
Usecase from Whatsapp (D67169920) to:
- use dtype selective build to create executorch_generated_lib
- use portable lib operators directly in C++
- ^cover these usecases in the same dependency
This requires removing the compiler flag '-fvisibility=hidden', so that the operator symbols are exposed in the archive file. Otherwise, we get missing operator symbols, like in P1697209425.
Duplicate symbols occur when we add the operator dependency explicitly, eg. adding `//executorch/kernels/portable/cpu:op_cat`, to the dep list. This is because dtype selective build re-builds the portable lib, and does not use the dependency `//executorch/kernels/portable:operators`, which uses the individual operator targets under the hood.
Another alternative is to expose the operator registry and add a helper utility to return the function ptr to the kernel, though this could be an intrusive change that opens operator registry to external clients outside the core runtime. cc tarun292.
Differential Revision: D672290961 parent 7924942 commit fb4056c
1 file changed
+17
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
392 | 406 | | |
393 | 407 | | |
394 | 408 | | |
| |||
398 | 412 | | |
399 | 413 | | |
400 | 414 | | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
| 415 | + | |
411 | 416 | | |
412 | 417 | | |
413 | 418 | | |
| |||
440 | 445 | | |
441 | 446 | | |
442 | 447 | | |
443 | | - | |
| 448 | + | |
| 449 | + | |
444 | 450 | | |
445 | 451 | | |
446 | 452 | | |
| |||
0 commit comments