Refactor windows arm64 for auto cpu detection #283
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #270
Before:
After fix (tested with
Pytorch 2.7.0
nightly):Example detection (printed messages only for debugging purposes):
Refactoring Windows ARM64 CPU detection with the MIDR implementation.
In this way, Windows detection will use the same structure as Linux.
Previously, some pre-defined CPU information was stored hardcoded in the source code. Now, it is automatically reading MIDR and decoding it.
MIDR documentation
Value is stored in:
Missing Snapdragon Oryon is added.
Previously
api.h
anduarch.c
were not used by Windows detection logic. However, to make it common with Linux, we are now using them.Since
restrict static
is not supported by MSVC, I had to add following macro.