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

MAINT: Remove warning when checking AVX512f on MSVC #18996

Merged
merged 1 commit into from
May 13, 2021

Conversation

mattip
Copy link
Member

@mattip mattip commented May 12, 2021

This appears in the checks for AVX512f features. @seiko2plus will the failure to build disable the optimization?

@charris charris changed the title remove warning on MSVC MAINT: Remove warning when checking AVX512f on MSVC May 12, 2021
@seiko2plus
Copy link
Member

will the failure to build disable the optimization?

No, test files with the prefix extra_ testing certain intrinsics that not necessarily to be supported by the compiler, usually functions or intrinsics that have no native support by the hardware.

checks/extra_avx512f_reduce.c enables the definition NPY_HAVE_AVX512F_REDUCE, see the following branch for more clarification:

#ifdef NPY_HAVE_AVX512F_REDUCE
#define npyv_sum_u32 _mm512_reduce_add_epi32
#define npyv_sum_u64 _mm512_reduce_add_epi64
#define npyv_sum_f32 _mm512_reduce_add_ps
#define npyv_sum_f64 _mm512_reduce_add_pd
#else
NPY_FINLINE npy_uint32 npyv_sum_u32(npyv_u32 a)
{
__m256i half = _mm256_add_epi32(npyv512_lower_si256(a), npyv512_higher_si256(a));
__m128i quarter = _mm_add_epi32(_mm256_castsi256_si128(half), _mm256_extracti128_si256(half, 1));
quarter = _mm_hadd_epi32(quarter, quarter);
return _mm_cvtsi128_si32(_mm_hadd_epi32(quarter, quarter));
}

@seiko2plus seiko2plus merged commit a7e1217 into numpy:main May 13, 2021
@seiko2plus
Copy link
Member

Thank you Matti

@seiko2plus seiko2plus added component: numpy.distutils component: SIMD Issues in SIMD (fast instruction sets) code or machinery labels May 13, 2021
@mattip mattip deleted the warning branch January 25, 2022 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
03 - Maintenance component: numpy.distutils component: SIMD Issues in SIMD (fast instruction sets) code or machinery
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants