-
Notifications
You must be signed in to change notification settings - Fork 21.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MPS][BE] Introduce MetalShaderLibary class (#125550)
That factors out a repeated pattern of creating a library/fetching a func from source Typical usecase ```cpp static MetalShaderLibrary lib(SHADER_SOURCE); ... id<MTLComputePipelineState> cplState = lib.getPipelieStateForFunc("kernel_name") ``` - Make it possible to use with templated sources - Add `scalarToMetalTypeString(const Tensor&)` variant to avoid repeated `scalarToMetalTypeString(t.scalar_type())` calls in the code I.e. it makes no functional changes, but reduces MPS codebase size by 365 lines Pull Request resolved: #125550 Approved by: https://github.com/kulinseth
- Loading branch information
1 parent
7bf6ed0
commit e30e6d3
Showing
14 changed files
with
163 additions
and
528 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.