Commit 2f0eb77
[webgpu] refactor initialization of WebGPU Context params (#26855)
### Description
refactor initialization of WebGPU Context params
The refactor:
- makes all WebGPU options into ~~3~~ 2 classes:
- `WebGpuExecutionProviderConfig`: configuration that passed to and
stored inside the EP class.
- ~~`WebGpuContextCreationParams`: configuration that passed to
constructor of class `WebGpuContext`.~~
- ~~`WebGpuContextInitializationParams`: configuration that passed to
`WebGpuContext::Initialize()`.~~
- `WebGpuContextConfig`: configuration that passed to construct and
initialize `WebGpuContext`.
- ensure all instance of the classes are created with default value
initialized.
- ensure all of the following happens only at one place:
- setting default value
- parse option
- add `WebGpuContextFactory::DefaultContext` to allow "get or create"
the default context.
### Motivation and Context
- Make code more clean and consistent.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>1 parent 38355ba commit 2f0eb77
File tree
4 files changed
+208
-246
lines changed- onnxruntime/core/providers/webgpu
4 files changed
+208
-246
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
| 40 | + | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
| 45 | + | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
138 | | - | |
139 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| |||
979 | 979 | | |
980 | 980 | | |
981 | 981 | | |
982 | | - | |
983 | | - | |
| 982 | + | |
984 | 983 | | |
985 | 984 | | |
986 | 985 | | |
987 | 986 | | |
988 | 987 | | |
989 | 988 | | |
990 | 989 | | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
991 | 994 | | |
992 | 995 | | |
993 | 996 | | |
| |||
1017 | 1020 | | |
1018 | 1021 | | |
1019 | 1022 | | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
1020 | 1028 | | |
1021 | 1029 | | |
1022 | 1030 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | 37 | | |
49 | 38 | | |
50 | 39 | | |
51 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
52 | 62 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
57 | 82 | | |
58 | 83 | | |
59 | 84 | | |
| |||
63 | 88 | | |
64 | 89 | | |
65 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
66 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
67 | 99 | | |
68 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
69 | 104 | | |
70 | 105 | | |
71 | 106 | | |
72 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
73 | 113 | | |
74 | 114 | | |
75 | 115 | | |
| |||
82 | 122 | | |
83 | 123 | | |
84 | 124 | | |
85 | | - | |
86 | | - | |
87 | 125 | | |
88 | 126 | | |
89 | 127 | | |
| |||
190 | 228 | | |
191 | 229 | | |
192 | 230 | | |
193 | | - | |
194 | | - | |
| 231 | + | |
195 | 232 | | |
196 | 233 | | |
197 | 234 | | |
198 | 235 | | |
199 | 236 | | |
200 | | - | |
201 | | - | |
| 237 | + | |
202 | 238 | | |
203 | 239 | | |
204 | 240 | | |
205 | 241 | | |
206 | 242 | | |
| 243 | + | |
| 244 | + | |
207 | 245 | | |
208 | 246 | | |
209 | 247 | | |
| |||
292 | 330 | | |
293 | 331 | | |
294 | 332 | | |
295 | | - | |
296 | 333 | | |
297 | 334 | | |
298 | 335 | | |
| |||
Lines changed: 3 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
42 | 33 | | |
43 | 34 | | |
44 | 35 | | |
| |||
0 commit comments