Skip to content

Commit 56a01ef

Browse files
committed
Fix: Check macro presence on Windows
1 parent 7243bf6 commit 56a01ef

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

include/simsimd/simsimd.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,10 +621,16 @@ SIMSIMD_PUBLIC simsimd_capability_t _simsimd_capabilities_arm(void) {
621621

622622
#elif defined(_SIMSIMD_DEFINED_WINDOWS)
623623

624+
unsigned supports_neon = 0, supports_dp = 0;
625+
624626
// On Windows ARM, use the `IsProcessorFeaturePresent` API for capability detection.
625627
// https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-isprocessorfeaturepresent
626-
unsigned supports_neon = IsProcessorFeaturePresent(PF_ARM_V8_INSTRUCTIONS_AVAILABLE);
627-
unsigned supports_dp = IsProcessorFeaturePresent(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE);
628+
#if defined(PF_ARM_V8_INSTRUCTIONS_AVAILABLE)
629+
supports_neon = IsProcessorFeaturePresent(PF_ARM_V8_INSTRUCTIONS_AVAILABLE);
630+
#endif
631+
#if defined(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE)
632+
supports_dp = IsProcessorFeaturePresent(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE);
633+
#endif
628634

629635
// Windows API doesn't provide reliable detection for FP16, BF16.
630636
return (simsimd_capability_t)( //

0 commit comments

Comments
 (0)