Skip to content

Commit

Permalink
target macros better
Browse files Browse the repository at this point in the history
  • Loading branch information
abeaucha committed Sep 20, 2024
1 parent ce98bcd commit eae685a
Showing 1 changed file with 4 additions and 1 deletion.
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

0 comments on commit eae685a

Please sign in to comment.