Commit 10d79a4
authored
[ET-VK] Refactor Context::flush() and make ComputeGraph destructor exception-safe (#17191)
Refactored Context::flush() by extracting two new public functions:
- wait_for_queue(): blocks until the GPU queue is idle
- clear_resources(): clears command/descriptor pools and cleanup lists
This allows callers to use these operations independently. ComputeGraph's
destructor now uses these functions directly and wraps them in try/catch
blocks to ensure it never throws exceptions, following C++ best practices
for destructors.
Authored with Claude.
Differential Revision: [D92171362](https://our.internmc.facebook.com/intern/diff/D92171362/)1 parent 3b819a2 commit 10d79a4
3 files changed
Lines changed: 26 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
| 229 | + | |
230 | 230 | | |
| 231 | + | |
231 | 232 | | |
| 233 | + | |
232 | 234 | | |
233 | 235 | | |
234 | 236 | | |
235 | | - | |
236 | 237 | | |
237 | 238 | | |
238 | 239 | | |
| |||
243 | 244 | | |
244 | 245 | | |
245 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
246 | 252 | | |
247 | 253 | | |
248 | 254 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
235 | 239 | | |
236 | 240 | | |
237 | 241 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
187 | 192 | | |
188 | | - | |
189 | | - | |
190 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
191 | 196 | | |
192 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
193 | 202 | | |
194 | 203 | | |
195 | 204 | | |
| |||
0 commit comments