-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use minipal_getcpufeatures to detect for AVX #113032
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
5a71048
to
e7edd2e
Compare
It could be OS-agnostic cshung/runtime@public/fix-avx-detection...am11:runtime:public/fix-avx-detection. |
TestingSuccessfully tested. Modified code for testing: SupportedISA DetermineSupportedISA()
{
int cpuFeatures = minipal_getcpufeatures();
if ((cpuFeatures & XArchIntrinsicConstants_Avx2) != 0)
{
printf( "Has AVX2 \n");
if ((cpuFeatures & XArchIntrinsicConstants_Avx512) != 0)
{
printf( "Has AVX-512 \n");
return (SupportedISA)((int)SupportedISA::AVX2 | (int)SupportedISA::AVX512F);
}
else
return SupportedISA::AVX2;
}
else
{
printf( "Doesn't have AVX2 \n");
return SupportedISA::None;
}
} Testing on a Machine with AVX-2 but not AVX-512.Processor: AMD EPYC 7763 64-Core Processor Windows .\corerun.exe .\GCPerfSim.dll -- -tc 16 -tagb 5 -tlgb 2 -lohpi 0 -sohsi 50 -ramb 20 -rlmb 2 -sohpi 0
Has AVX2 Linux./corerun GCPerfSim.dll -- -tc 16 -tagb 5 -tlgb
2 -lohpi 0 -sohsi 50 -ramb 20 -rlmb 2 -sohpi 0
Has AVX2 Testing on a Machine with AVX-512Windows./corerun ,exe GCPerfSim.dll -- -tc 16 -tagb 5 -tlgb 2 -l
ohpi 0 -sohsi 50 -ramb 20 -rlmb 2 -sohpi 0
Has AVX2
Has AVX-512 Linux.\corerun .\GCPerfSim.dll -- -tc 16 -tagb 5 -tlgb 2 -lohpi 0 -sohsi 50 -ramb 20 -rlmb 2 -sohpi 0
Has AVX2
Has AVX-512 Testing on a Machine with AVX* disabled
Windowscorerun.exe GCPerfSim.dll -- -tc 16 -tagb 5 -tlgb 2 -lohpi 0 -sohsi 50 -ramb 20 -rlmb 2 -sohpi 0
Doesn't have AVX2 Linux./corerun GCPerfSim.dll -- -tc 16 -tagb 5 -tlgb 2 -lohpi 0 -sohsi 50 -ramb 20 -rlmb 2 -sohpi 0
Doesn't have AVX2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Tested extensively.
Should it be backported? |
yeah trying to validate the fix, and determine priority since it doesnt seem to be failing broadly across all hardware as far as we can tell, so guessing its not certain CPU skus. |
This should fix #112897