Commit 9b3925d
Clean up OperatorRegistry (#2304)
Summary:
bypass-github-export-checks
Pull Request resolved: #2304
Align `OperatorRegistry` with the style of `ShaderRegistry` in #2222
This means
- Improve comments and comment formatting.
- Use snake case, even if it deviates from the original registry I was following. Snake case is more consistent with the Vulkan backend code.
https://www.internalfb.com/code/fbsource/[a97f9ed1a715231bb61b05942273f1e8f8631503]/fbcode/executorch/runtime/kernel/operator_registry.h?lines=208%2C213
- Move `using` declarations and member variables to top of class definition.
- Place static `OperatorRegistry` instance declaration in a global function `operator_registry()` instead of in member function `getInstance()`.
- Use macros to wrap `OperatorRegistry` functions instead of global functions.
- For simplicity, remove unneeded ctor and assignment operator deletion/hiding. Note users can now create their own non-static `OperatorRegistry` instance and we can consider hiding this again later.
ghstack-source-id: 217884084
exported-using-ghexport
Reviewed By: SS-JIA
Differential Revision: D54640160
fbshipit-source-id: 298e19b07e505f37326f216e6fa4eb8e6513fec61 parent ed079d1 commit 9b3925d
File tree
3 files changed
+40
-45
lines changed- backends/vulkan/runtime
- graph/ops
3 files changed
+40
-45
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 17 | + | |
31 | 18 | | |
32 | 19 | | |
33 | 20 | | |
34 | | - | |
| 21 | + | |
| 22 | + | |
35 | 23 | | |
36 | 24 | | |
37 | 25 | | |
38 | 26 | | |
39 | 27 | | |
40 | 28 | | |
41 | | - | |
| 29 | + | |
42 | 30 | | |
43 | 31 | | |
44 | 32 | | |
| |||
50 | 38 | | |
51 | 39 | | |
52 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
53 | 46 | | |
54 | 47 | | |
55 | 48 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
18 | 23 | | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
46 | 36 | | |
47 | | - | |
| 37 | + | |
48 | 38 | | |
49 | 39 | | |
50 | | - | |
51 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
52 | 50 | | |
53 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| |||
0 commit comments