8000 BUG: Fix build on ppc64 when the baseline set to Power9 or higher · charris/numpy@0cccd5f · GitHub
[go: up one dir, main page]

Skip to content

Commit 0cccd5f

Browse files
committed
BUG: Fix build on ppc64 when the baseline set to Power9 or higher
Backport of numpy#24806. This backport was already made in numpy#25083, but that didn't make use of the linux_qemu.yml action, so this tweaks it a bit.
1 parent 2cc17ec commit 0cccd5f

File tree

5 files changed

+19
-269
lines changed

5 files changed

+19
-269
lines changed

.github/workflows/linux_qemu.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ concurrency:
2323
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
2424
cancel-in-progress: true
2525

26+
permissions:
27+
contents: read
28+
2629
jobs:
2730
linux_qemu:
2831
if: "github.repository == 'numpy/numpy'"
@@ -48,6 +51,13 @@ jobs:
4851
"-Dallow-noblas=true",
4952
"test_kind or test_multiarray or test_simd or test_umath or test_ufunc",
5053
]
54+
- [
55+
"ppc64le - baseline(Power9)",
56+
"powerpc64le-linux-gnu",
57+
"ppc64le/ubuntu:22.04",
58+
"-Dallow-noblas=true -Dcpu-baseline=vsx3",
59+
"test_kind or test_multiarray or test_simd or test_umath or test_ufunc",
60+
]
5161
- [
5262
"s390x",
5363
"s390x-linux-gnu",
@@ -74,7 +84,7 @@ jobs:
7484

7585
name: "${{ matrix.BUILD_PROP[0] }}"
7686
steps:
77-
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
87+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
7888
with:
7989
submodules: recursive
8090
fetch-depth: 0

meson_cpu/ppc64/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ VSX3 = mod_features.new(
3333
VSX4 = mod_features.new(
3434
'VSX4', 4, implies: VSX3, args: {'val': '-mcpu=power10', 'match': '.*[mcpu=|vsx].*'},
3535
detect: {'val': 'VSX4', 'match': 'VSX.*'},
36-
test_code: files(source_root + '/numpy/distutils/checks/cpu_vsx3.c')[0],
36+
test_code: files(source_root + '/numpy/distutils/checks/cpu_vsx4.c')[0],
3737
extra_tests: {
3838
'VSX4_MMA': files(source_root + '/numpy/distutils/checks/extra_vsx4_mma.c')[0]
3939
}

numpy/core/src/common/half.hpp

Lines changed: 0 additions & 261 deletions
This file was deleted.

numpy/core/tests/test_half.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,17 +274,17 @@ def test_half_correctness(self):
274274
if len(a32_fail) != 0:
275275
bad_index = a32_fail[0]
276276
assert_equal(self.finite_f32, a_manual,
277-
"First non-equal is half value %x -> %g != %g" %
278-
(self.finite_f16[bad_index],
277+
"First non-equal is half value 0x%x -> %g != %g" %
278+
(a_bits[bad_index],
279279
self.finite_f32[bad_index],
280280
a_manual[bad_index]))
281281

282282
a64_fail = np.nonzero(self.finite_f64 != a_manual)[0]
283283
if len(a64_fail) != 0:
284284
bad_index = a64_fail[0]
285285
assert_equal(self.finite_f64, a_manual,
286-
"First non-equal is half value %x -> %g != %g" %
287-
(self.finite_f16[bad_index],
286+
"First non-equal is half value 0x%x -> %g != %g" %
287+
(a_bits[bad_index],
288288
self.finite_f64[bad_index],
289289
a_manual[bad_index]))
290290

@@ -327,7 +327,8 @@ def test_half_funcs(self):
327327
a = np.array([0, 0, -1, -1/1e20, 0, 2.0**-24, 7.629e-6], dtype=float16)
328328
assert_equal(a.nonzero()[0],
329329
[2, 5, 6])
330-
a = a.byteswap().newbyteorder()
330+
a = a.byteswap()
331+
a = a.view(a.dtype.newbyteorder())
331332
assert_equal(a.nonzero()[0],
332333
[2, 5, 6])
333334

numpy/distutils/ccompiler_opt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,7 @@ def feature_names(self, names=None, force_flags=None, macros=[]):
13091309
def feature_is_exist(self, name):
13101310
"""
13111311
Returns True if a certain feature is exist and covered within
1312-
`_Config.conf_features`.
1312+
``_Config.conf_features``.
13131313
13141314
Parameters
13151315
----------

0 commit comments

Comments
 (0)
0