pytorch
d6def7a8 - [vulkan] Refactor Shader and Pipeline (#80700)

Commit
2 years ago
[vulkan] Refactor Shader and Pipeline (#80700) ## Context This PR refactors the Shader and Pipeline files to improve code readability and organization. The outcomes of this refactor are: - Reduced nesting in classes. For instance, Shader layout objects previously had to be accessed via `Shader::Layout::Object`, but after this refactor can be accessed by simply `ShaderLayout` - Removal of the `Cache` class. This class is simply a wrapper around `ska::flat_hash_map`, but usage requires the definition of several helper classes (such as `Factory`, `Descriptor`, and `Hasher` classes, not to mention the definition of another `Cache` class to wrap `api/Cache`) that bloats the codebase and makes it difficult to understand what's going on. After this refactor, `ska::flat_hash_map` is a direct member of the classes that use them. - Further removal of usage of the `Handle` class which was started in https://github.com/pytorch/pytorch/pull/74698. This class standardizes the management of Vulkan handles via templates, but is ultimately hard to understand and adds an unnecessary layer of complexity when working with Vulkan handles. This PR should not change any behaviour, it simply re-organizes these classes and improves readability of the code-base. Differential Revision: [D36493832](https://our.internmc.facebook.com/intern/diff/D36493832/) Pull Request resolved: https://github.com/pytorch/pytorch/pull/80700 Approved by: https://github.com/kimishpatel
Author
Committer
Parents
Loading