Created
January 7, 2021 07:05
-
-
Save kaityo256/3b89fbddb2952e12699d089c20ffa416 to your computer and use it in GitHub Desktop.
Check availability and length of SVE
This file contains hidden or 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
#include <cstdio> | |
#ifdef __ARM_FEATURE_SVE | |
#include <arm_sve.h> | |
#endif | |
int main() { | |
int n = 0; | |
#ifdef __ARM_FEATURE_SVE | |
n = svcntb() * 8; | |
#endif | |
if (n) { | |
printf("SVE is available. The length is %d bits\n", n); | |
} else { | |
printf("SVE is unavailable.\n"); | |
} | |
} |
Author
kaityo256
commented
Jan 7, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment