Commit a0909c2
jorgep31415
Update on "[ET-VK] Move
## Issue
`Runtime` is a local static variable. Hence we'd expect the Runtime dtor to be called on program exit. But on Android devices it's not being invoked. This behavior is different than that seen 6 months ago (D57085281). It's unclear what changed.
This means the cache is not saved due to the following chain never being invoked.
`~Runtime()` > `~Adapter()` > `~ComputePipelineCache()` > `save_cache()`.\
## Solution
Move cache saving to `VulkanBackend.cpp`'s model destroy. This makes sense since the cache is tied to the model and not the runtime.
## Resources
https://medium.com/martin00001313/mastering-static-objects-in-c-initialization-destruction-and-best-practices-760b17734195
Differential Revision: [D66179917](https://our.internmc.facebook.com/intern/diff/D66179917/)
[ghstack-poisoned]save_cache from Runtime dtor to model destroy"1 parent 13a640c commit a0909c2
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
621 | 621 | | |
622 | 622 | | |
623 | 623 | | |
624 | | - | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
625 | 628 | | |
626 | 629 | | |
627 | 630 | | |
| |||
0 commit comments