Skip to content
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

Windows Avx macro tweak #776

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion modules/c++/sys/source/OSWin32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,14 @@ void sys::OSWin32::getAvailableCPUs(std::vector<int>& /*physicalCPUs*/,
sys::SIMDInstructionSet sys::OSWin32::getSIMDInstructionSet() const
{
// https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-isprocessorfeaturepresent
#if _MSC_VER >= 1920
// (these require Windows SDK (19041) or later)
#ifdef PF_AVX512F_INSTRUCTIONS_AVAILABLE
if (IsProcessorFeaturePresent(PF_AVX512F_INSTRUCTIONS_AVAILABLE))
{
return SIMDInstructionSet::AVX512F;
}
#endif
#ifdef PF_AVX2_INSTRUCTIONS_AVAILABLE
if (IsProcessorFeaturePresent(PF_AVX2_INSTRUCTIONS_AVAILABLE))
{
return SIMDInstructionSet::AVX2;
Expand Down
Loading