Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MAINT: Init base in cpu_avx512_kn #25419

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

Merged
merged 2 commits into from
Dec 18, 2023

Conversation

charris
Copy link
Member

@charris charris commented Dec 18, 2023

Backport of #25383.

Fix a false negative due to a warning that base could be uninitialized, e.g. on GCC 12.3.0

See the output:

extra options: '-msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -mf16c -mfma -mavx2 -mavx512f -mno-mmx -mavx512cd -mavx512er -mavx512pf -Werror'
WARN: CCompilerOpt.dist_test[636] : CCompilerOpt._dist_test_spawn[770] : Command (gcc -DNDEBUG -g -fwrapv -O3 -Wall -O3 -march=native -fno-math-errno -fPIC -O3 -march=native -fno-math-errno -fPIC -O1 -march=n
ative -fno-math-errno -fPIC -I/software/FFTW/3.3.10-GCC-12.3.0/include -I/software/FlexiBLAS/3.3.1-GCC-12.3.
0/include -I/software/FlexiBLAS/3.3.1-GCC-12.3.0/include/flexiblas -fPIC -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inump
y/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/src/_simd -I/software/Python/3.11.3-GCCcore-12.3.0/include/python3.11 -Ibui
ld/src.linux-x86_64-3.11/numpy/core/src/common -Ibuild/src.linux-x86_64-3.11/numpy/core/src/npymath -c /build/numpy/numpy-1.25.1/numpy/distutils/chec
ks/cpu_avx512_knl.c -o /build2/numpy/numpy-1.25.1/numpy/distutils/checks/cpu_avx512_knl.o -MMD -MF /tmp/easy
build-tmp/eb-xmfgsmk1/tmp6dmww85r/build/numpy/numpy-1.25.1/numpy/distutils/checks/cpu_avx512_knl.o.d -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -m
sse4.2 -mavx -mf16c -mfma -mavx2 -mavx512f -mno-mmx -mavx512cd -mavx512er -mavx512pf -Werror) failed with exit status 1 output -> 
In Datei, eingebunden von /software/GCCcore/12.3.0/lib/gcc/x86_64-pc-linux-gnu/12.3.0/include/immintrin.h:53,
                 von /build/numpy/numpy-1.25.1/numpy/distutils/checks/cpu_avx512_knl.c:14:
In Funktion _mm512_mask_prefetch_i64scatter_pd,
    eingefgt von main bei /build/numpy/numpy-1.25.1/numpy/distutils/checks/cpu_avx512_knl.c:23:5:
/software/GCCcore/12.3.0/lib/gcc/x86_64-pc-linux-gnu/12.3.0/include/avx512pfintrin.h:180:3: Fehler: base knnte uninitialisiert verwendet werden [-Werror=maybe-uninitialized]
  180 |   __builtin_ia32_scatterpfqpd (__mask, (__v8di) __index, __addr, __scale,
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  181 |                                __hint);
      |                                ~~~~~~~
<eingebaut>: In Funktion main:
<eingebaut>: Anmerkung: durch Argument 3 vom Typ const void * nach __builtin_ia32_scatterpfqpd, die hier deklariert wurde
/build/numpy/numpy-1.25.1/numpy/distutils/checks/cpu_avx512_knl.c:18:9: Anmerkung: base ist hier deklariert
   18 |     int base[128];
      |         ^~~~
cc1: Alle Warnungen werden als Fehler behandelt

Whether or not that is a false positive warning of GCC doesn't really matter as the change doesn't hurt

Fix a false negative due to a warning that `base` could be uninitialized, e.g. on GCC 12.3.0
@charris charris added 08 - Backport Used to tag backport PRs component: SIMD Issues in SIMD (fast instruction sets) code or machinery 36 - Build Build related PR labels Dec 18, 2023
@charris charris added this to the 1.26.3 release milestone Dec 18, 2023
@charris charris merged commit ba4cc02 into numpy:maintenance/1.26.x Dec 18, 2023
@charris charris deleted the backport-25383 branch December 18, 2023 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
03 - Maintenance 08 - Backport Used to tag backport PRs 36 - Build Build related PR component: SIMD Issues in SIMD (fast instruction sets) code or machinery
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants