-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Add HardwareIntrinsics AVX-512 info #2412
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
Changes from 3 commits
18633be
b50c942
5f5df17
516f013
c221774
df7e5ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Diagnostics.CodeAnalysis; | ||
| using System.Numerics; | ||
| using BenchmarkDotNet.Environments; | ||
| using System.Diagnostics.CodeAnalysis; | ||
| #if NET6_0_OR_GREATER | ||
| using System.Runtime.Intrinsics.X86; | ||
| using System.Runtime.Intrinsics.Arm; | ||
|
|
@@ -16,6 +16,8 @@ internal static class HardwareIntrinsics | |
|
|
||
| internal static string GetShortInfo() | ||
| { | ||
| if (IsX86Avx512FSupported) | ||
| return "AVX-512"; | ||
| if (IsX86Avx2Supported) | ||
| return "AVX2"; | ||
| else if (IsX86AvxSupported) | ||
|
|
@@ -52,6 +54,12 @@ static IEnumerable<string> GetCurrentProcessInstructionSets(Platform platform) | |
| { | ||
| case Platform.X86: | ||
| case Platform.X64: | ||
| if (IsX86Avx512FSupported) yield return "AVX-512F"; | ||
| if (IsX86Avx512BWSupported) yield return "AVX-512BW"; | ||
| if (IsX86Avx512CDSupported) yield return "AVX-512CD"; | ||
| if (IsX86Avx512DQSupported) yield return "AVX-512DQ"; | ||
| if (IsX86Avx512VbmiSupported) yield return "AVX-512VBMI"; | ||
|
|
||
|
||
| if (IsX86Avx2Supported) yield return "AVX2"; | ||
| else if (IsX86AvxSupported) yield return "AVX"; | ||
| else if (IsX86Sse42Supported) yield return "SSE4.2"; | ||
|
|
@@ -153,6 +161,41 @@ static IEnumerable<string> GetCurrentProcessInstructionSets(Platform platform) | |
| GetIsSupported("System.Runtime.Intrinsics.X86.Avx2"); | ||
| #endif | ||
|
|
||
| internal static bool IsX86Avx512FSupported => | ||
adamsitnik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| #if NET8_0_OR_GREATER | ||
| Avx512F.IsSupported; | ||
| #else | ||
| GetIsSupported("System.Runtime.Intrinsics.X86.Avx512F"); | ||
| #endif | ||
|
|
||
| internal static bool IsX86Avx512BWSupported => | ||
| #if NET8_0_OR_GREATER | ||
| Avx512BW.IsSupported; | ||
| #else | ||
| GetIsSupported("System.Runtime.Intrinsics.X86.Avx512BW"); | ||
| #endif | ||
|
|
||
| internal static bool IsX86Avx512CDSupported => | ||
| #if NET8_0_OR_GREATER | ||
| Avx512CD.IsSupported; | ||
| #else | ||
| GetIsSupported("System.Runtime.Intrinsics.X86.Avx512CD"); | ||
| #endif | ||
|
|
||
| internal static bool IsX86Avx512DQSupported => | ||
| #if NET8_0_OR_GREATER | ||
| Avx512DQ.IsSupported; | ||
| #else | ||
| GetIsSupported("System.Runtime.Intrinsics.X86.Avx512DQ"); | ||
| #endif | ||
|
|
||
| internal static bool IsX86Avx512VbmiSupported => | ||
| #if NET8_0_OR_GREATER | ||
| Avx512Vbmi.IsSupported; | ||
| #else | ||
| GetIsSupported("System.Runtime.Intrinsics.X86.Avx512Vbmi"); | ||
| #endif | ||
|
|
||
| internal static bool IsX86AesSupported => | ||
| #if NET6_0_OR_GREATER | ||
| System.Runtime.Intrinsics.X86.Aes.IsSupported; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.