Skip to content

Commit 4199b57

Browse files
committed
conjunction nan
1 parent 770c117 commit 4199b57

2 files changed

Lines changed: 175 additions & 175 deletions

File tree

.github/workflows/build_wheels.yml

Lines changed: 173 additions & 173 deletions
Original file line numberDiff line numberDiff line change
@@ -16,179 +16,179 @@ on:
1616
workflow_dispatch:
1717

1818
jobs:
19-
# build_wheels_linux:
20-
# name: Build wheels on Linux
21-
# runs-on: ubuntu-latest
22-
# steps:
23-
# - uses: actions/checkout@v6
24-
25-
# - name: Set up Python
26-
# uses: actions/setup-python@v6
27-
# with:
28-
# python-version: ">=3.11.0"
29-
30-
# - name: Install cibuildwheel
31-
# run: pip install cibuildwheel==3.1.4
32-
33-
# - name: Build wheels
34-
# env:
35-
# CIBW_BUILD: "cp311-manylinux_x86_64 cp312-manylinux_x86_64 cp313-manylinux_x86_64 cp313t-manylinux_x86_64 cp314-manylinux_x86_64 cp314t-manylinux_x86_64"
36-
# CIBW_ENABLE: cpython-prerelease cpython-freethreading
37-
# CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
38-
# CIBW_BUILD_VERBOSITY: "3"
39-
# CIBW_BEFORE_ALL: |
40-
# yum update -y
41-
# yum install -y cmake gcc gcc-c++ make git pkgconfig
42-
# CIBW_BEFORE_BUILD: |
43-
# pip install meson>=1.3.2 meson-python>=0.18.0 wheel ninja
44-
# pip install --pre --upgrade --timeout=60 --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
45-
# CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation"
46-
# CIBW_ENVIRONMENT: >
47-
# LDFLAGS="-fopenmp"
48-
# CIBW_REPAIR_WHEEL_COMMAND: |
49-
# auditwheel repair -w {dest_dir} --plat manylinux_2_28_x86_64 {wheel}
50-
# CIBW_TEST_COMMAND: |
51-
# pip install --pre --upgrade --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
52-
# pip install --no-deps {wheel}
53-
# pip install pytest pytest-run-parallel
54-
# if python -c "import sys; exit(0 if hasattr(sys, '_is_gil_enabled') and not sys._is_gil_enabled() else 1)"; then
55-
# pytest --parallel-threads=10 --iterations=10 {project}/tests
56-
# else
57-
# pytest -s {project}/tests
58-
# fi
59-
# CIBW_TEST_EXTRAS: "test"
60-
# run: |
61-
# python -m cibuildwheel --output-dir wheelhouse
62-
# working-directory: ./quaddtype
63-
64-
# - uses: actions/upload-artifact@v6
65-
# with:
66-
# path: ./quaddtype/wheelhouse/*.whl
67-
# name: wheels-linux
68-
69-
# build_wheels_macos:
70-
# name: Build wheels on ${{ matrix.os }}
71-
# runs-on: ${{ matrix.os }}
72-
# strategy:
73-
# matrix:
74-
# os: [macos-14, macos-15, macos-15-intel]
75-
76-
# steps:
77-
# - uses: actions/checkout@v6
78-
79-
# - name: Set up Python
80-
# uses: actions/setup-python@v6
81-
# with:
82-
# python-version: ">=3.11.0"
83-
84-
# - name: Install dependencies
85-
# run: |
86-
# packages="cmake libomp git"
87-
# echo "Remove preinstalled dependencies"
88-
# for pkg in $packages; do
89-
# brew uninstall --ignore-dependencies $pkg 2>/dev/null || true
90-
# done
91-
# brew cleanup
92-
# brew install $packages
93-
94-
# - name: Installing Python dependencies
95-
# run: |
96-
# pip install -U pip
97-
# pip install cibuildwheel==3.1.4
98-
# pip install pytest-run-parallel
99-
100-
# - name: Build wheels
101-
# env:
102-
# CIBW_BUILD: "cp311-* cp312-* cp313-* cp314-* cp313t-* cp314t-*"
103-
# CIBW_ENABLE: cpython-prerelease cpython-freethreading
104-
# # CIBW_ARCHS_MACOS: ${{ matrix.os == 'macos-13' && 'x86_64' || 'arm64' }}
105-
# CIBW_BUILD_VERBOSITY: "3"
106-
# CIBW_BEFORE_BUILD: |
107-
# pip install meson>=1.3.2 meson-python>=0.18.0 wheel ninja
108-
# pip install --pre --upgrade --timeout=60 --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
109-
# CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation"
110-
# CIBW_ENVIRONMENT: >
111-
# MACOSX_DEPLOYMENT_TARGET="${{ matrix.os == 'macos-14' && '14.0' || '15.0' }}"
112-
# CIBW_REPAIR_WHEEL_COMMAND: >
113-
# delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
114-
# CIBW_TEST_COMMAND: |
115-
# pip install --pre --upgrade --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
116-
# pip install --no-deps {wheel}
117-
# pip install pytest pytest-run-parallel
118-
# if python -c "import sys; exit(0 if hasattr(sys, '_is_gil_enabled') and not sys._is_gil_enabled() else 1)"; then
119-
# pytest --parallel-threads=10 --iterations=10 {project}/tests
120-
# else
121-
# pytest -s {project}/tests
122-
# fi
123-
# CIBW_TEST_EXTRAS: "test"
124-
# run: |
125-
# python -m cibuildwheel --output-dir wheelhouse
126-
# working-directory: ./quaddtype
127-
128-
# - uses: actions/upload-artifact@v6
129-
# with:
130-
# path: ./quaddtype/wheelhouse/*.whl
131-
# name: wheels-${{ matrix.os }}
132-
133-
# # disabling QBLAS optimization for windows due to incompatibility with MSVC
134-
# build_wheels_windows:
135-
# name: Build wheels on Windows
136-
# runs-on: windows-latest
137-
# strategy:
138-
# matrix:
139-
# architecture: [x64]
140-
141-
# steps:
142-
# - uses: actions/checkout@v6
143-
144-
# - name: Setup MSVC
145-
# uses: ilammy/msvc-dev-cmd@v1
146-
# with:
147-
# arch: ${{ matrix.architecture }}
148-
149-
# - name: Set up Python
150-
# uses: actions/setup-python@v6
151-
# with:
152-
# python-version: ">=3.11.0"
153-
# architecture: ${{ matrix.architecture }}
154-
155-
# - name: Install CMake
156-
# uses: lukka/get-cmake@latest
157-
158-
# - name: Install build dependencies
159-
# shell: bash -l {0}
160-
# run: |
161-
# pip install -U pip
162-
# pip install cibuildwheel==3.1.4 ninja meson meson-python numpy delvewheel pytest
163-
164-
# - name: Build wheels
165-
# env:
166-
# CIBW_BUILD: "cp311-* cp312-* cp313-* cp314-* cp313t-* cp314t-*"
167-
# CIBW_ENABLE: cpython-prerelease cpython-freethreading
168-
# CIBW_ARCHS_WINDOWS: ${{ matrix.architecture == 'x86' && 'x86' || 'AMD64' }}
169-
# CIBW_BUILD_VERBOSITY: "3"
170-
# DISTUTILS_USE_SDK: "1"
171-
# MSSdk: "1"
172-
# CIBW_BEFORE_BUILD: >-
173-
# pip install meson meson-python ninja wheel &&
174-
# pip install --pre --upgrade --timeout=60 --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
175-
# CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation"
176-
# CIBW_ENVIRONMENT: >
177-
# CFLAGS="/DDISABLE_QUADBLAS $CFLAGS"
178-
# CXXFLAGS="/DDISABLE_QUADBLAS $CXXFLAGS"
179-
# CIBW_REPAIR_WHEEL_COMMAND: 'delvewheel repair -w {dest_dir} {wheel} --add-path C:\sleef\bin'
180-
# CIBW_TEST_COMMAND_WINDOWS: pip install --pre --upgrade --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy && pip install --no-deps {wheel} && pip install pytest pytest-run-parallel && pytest -s {project}/tests
181-
# CIBW_TEST_EXTRAS: test
182-
# shell: pwsh
183-
# run: |
184-
# python -m cibuildwheel --output-dir wheelhouse
185-
# if (-not (Test-Path wheelhouse/*.whl)) { throw "Wheel was not created" }
186-
# working-directory: ./quaddtype
187-
188-
# - uses: actions/upload-artifact@v6
189-
# with:
190-
# path: ./quaddtype/wheelhouse/*.whl
191-
# name: wheels-windows-${{ matrix.architecture }}
19+
build_wheels_linux:
20+
name: Build wheels on Linux
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v6
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v6
27+
with:
28+
python-version: ">=3.11.0"
29+
30+
- name: Install cibuildwheel
31+
run: pip install cibuildwheel==3.1.4
32+
33+
- name: Build wheels
34+
env:
35+
CIBW_BUILD: "cp311-manylinux_x86_64 cp312-manylinux_x86_64 cp313-manylinux_x86_64 cp313t-manylinux_x86_64 cp314-manylinux_x86_64 cp314t-manylinux_x86_64"
36+
CIBW_ENABLE: cpython-prerelease cpython-freethreading
37+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
38+
CIBW_BUILD_VERBOSITY: "3"
39+
CIBW_BEFORE_ALL: |
40+
yum update -y
41+
yum install -y cmake gcc gcc-c++ make git pkgconfig
42+
CIBW_BEFORE_BUILD: |
43+
pip install meson>=1.3.2 meson-python>=0.18.0 wheel ninja
44+
pip install --pre --upgrade --timeout=60 --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
45+
CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation"
46+
CIBW_ENVIRONMENT: >
47+
LDFLAGS="-fopenmp"
48+
CIBW_REPAIR_WHEEL_COMMAND: |
49+
auditwheel repair -w {dest_dir} --plat manylinux_2_28_x86_64 {wheel}
50+
CIBW_TEST_COMMAND: |
51+
pip install --pre --upgrade --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
52+
pip install --no-deps {wheel}
53+
pip install pytest pytest-run-parallel
54+
if python -c "import sys; exit(0 if hasattr(sys, '_is_gil_enabled') and not sys._is_gil_enabled() else 1)"; then
55+
pytest --parallel-threads=10 --iterations=10 {project}/tests
56+
else
57+
pytest -s {project}/tests
58+
fi
59+
CIBW_TEST_EXTRAS: "test"
60+
run: |
61+
python -m cibuildwheel --output-dir wheelhouse
62+
working-directory: ./quaddtype
63+
64+
- uses: actions/upload-artifact@v6
65+
with:
66+
path: ./quaddtype/wheelhouse/*.whl
67+
name: wheels-linux
68+
69+
build_wheels_macos:
70+
name: Build wheels on ${{ matrix.os }}
71+
runs-on: ${{ matrix.os }}
72+
strategy:
73+
matrix:
74+
os: [macos-14, macos-15, macos-15-intel]
75+
76+
steps:
77+
- uses: actions/checkout@v6
78+
79+
- name: Set up Python
80+
uses: actions/setup-python@v6
81+
with:
82+
python-version: ">=3.11.0"
83+
84+
- name: Install dependencies
85+
run: |
86+
packages="cmake libomp git"
87+
echo "Remove preinstalled dependencies"
88+
for pkg in $packages; do
89+
brew uninstall --ignore-dependencies $pkg 2>/dev/null || true
90+
done
91+
brew cleanup
92+
brew install $packages
93+
94+
- name: Installing Python dependencies
95+
run: |
96+
pip install -U pip
97+
pip install cibuildwheel==3.1.4
98+
pip install pytest-run-parallel
99+
100+
- name: Build wheels
101+
env:
102+
CIBW_BUILD: "cp311-* cp312-* cp313-* cp314-* cp313t-* cp314t-*"
103+
CIBW_ENABLE: cpython-prerelease cpython-freethreading
104+
# CIBW_ARCHS_MACOS: ${{ matrix.os == 'macos-13' && 'x86_64' || 'arm64' }}
105+
CIBW_BUILD_VERBOSITY: "3"
106+
CIBW_BEFORE_BUILD: |
107+
pip install meson>=1.3.2 meson-python>=0.18.0 wheel ninja
108+
pip install --pre --upgrade --timeout=60 --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
109+
CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation"
110+
CIBW_ENVIRONMENT: >
111+
MACOSX_DEPLOYMENT_TARGET="${{ matrix.os == 'macos-14' && '14.0' || '15.0' }}"
112+
CIBW_REPAIR_WHEEL_COMMAND: >
113+
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
114+
CIBW_TEST_COMMAND: |
115+
pip install --pre --upgrade --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
116+
pip install --no-deps {wheel}
117+
pip install pytest pytest-run-parallel
118+
if python -c "import sys; exit(0 if hasattr(sys, '_is_gil_enabled') and not sys._is_gil_enabled() else 1)"; then
119+
pytest --parallel-threads=10 --iterations=10 {project}/tests
120+
else
121+
pytest -s {project}/tests
122+
fi
123+
CIBW_TEST_EXTRAS: "test"
124+
run: |
125+
python -m cibuildwheel --output-dir wheelhouse
126+
working-directory: ./quaddtype
127+
128+
- uses: actions/upload-artifact@v6
129+
with:
130+
path: ./quaddtype/wheelhouse/*.whl
131+
name: wheels-${{ matrix.os }}
132+
133+
# disabling QBLAS optimization for windows due to incompatibility with MSVC
134+
build_wheels_windows:
135+
name: Build wheels on Windows
136+
runs-on: windows-latest
137+
strategy:
138+
matrix:
139+
architecture: [x64]
140+
141+
steps:
142+
- uses: actions/checkout@v6
143+
144+
- name: Setup MSVC
145+
uses: ilammy/msvc-dev-cmd@v1
146+
with:
147+
arch: ${{ matrix.architecture }}
148+
149+
- name: Set up Python
150+
uses: actions/setup-python@v6
151+
with:
152+
python-version: ">=3.11.0"
153+
architecture: ${{ matrix.architecture }}
154+
155+
- name: Install CMake
156+
uses: lukka/get-cmake@latest
157+
158+
- name: Install build dependencies
159+
shell: bash -l {0}
160+
run: |
161+
pip install -U pip
162+
pip install cibuildwheel==3.1.4 ninja meson meson-python numpy delvewheel pytest
163+
164+
- name: Build wheels
165+
env:
166+
CIBW_BUILD: "cp311-* cp312-* cp313-* cp314-* cp313t-* cp314t-*"
167+
CIBW_ENABLE: cpython-prerelease cpython-freethreading
168+
CIBW_ARCHS_WINDOWS: ${{ matrix.architecture == 'x86' && 'x86' || 'AMD64' }}
169+
CIBW_BUILD_VERBOSITY: "3"
170+
DISTUTILS_USE_SDK: "1"
171+
MSSdk: "1"
172+
CIBW_BEFORE_BUILD: >-
173+
pip install meson meson-python ninja wheel &&
174+
pip install --pre --upgrade --timeout=60 --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
175+
CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation"
176+
CIBW_ENVIRONMENT: >
177+
CFLAGS="/DDISABLE_QUADBLAS $CFLAGS"
178+
CXXFLAGS="/DDISABLE_QUADBLAS $CXXFLAGS"
179+
CIBW_REPAIR_WHEEL_COMMAND: 'delvewheel repair -w {dest_dir} {wheel} --add-path C:\sleef\bin'
180+
CIBW_TEST_COMMAND_WINDOWS: pip install --pre --upgrade --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy && pip install --no-deps {wheel} && pip install pytest pytest-run-parallel && pytest -s {project}/tests
181+
CIBW_TEST_EXTRAS: test
182+
shell: pwsh
183+
run: |
184+
python -m cibuildwheel --output-dir wheelhouse
185+
if (-not (Test-Path wheelhouse/*.whl)) { throw "Wheel was not created" }
186+
working-directory: ./quaddtype
187+
188+
- uses: actions/upload-artifact@v6
189+
with:
190+
path: ./quaddtype/wheelhouse/*.whl
191+
name: wheels-windows-${{ matrix.architecture }}
192192

193193
build_sdist:
194194
name: Build SDist

quaddtype/numpy_quaddtype/src/casts.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ quad_to_quad_same_value_check(const quad_value *in_val, QuadBackendType backend_
9898

9999
// Compare in SLEEF domain && signbit preserved
100100
bool is_sign_preserved = (quad_signbit(&in_val->sleef_value) == quad_signbit(&roundtrip.sleef_value));
101-
if (Sleef_iunordq1(in_val->sleef_value, roundtrip.sleef_value) && is_sign_preserved)
101+
if(quad_isnan(&in_val->sleef_value) && quad_isnan(&roundtrip.sleef_value) && is_sign_preserved)
102102
return 1; // Both NaN
103103
if (Sleef_icmpeqq1(in_val->sleef_value, roundtrip.sleef_value) && is_sign_preserved)
104104
return 1; // Equal
@@ -443,7 +443,7 @@ quad_to_string_same_value_check(const quad_value *in_val, const char *str_buf, n
443443
// Compare original and roundtripped values along with signbit
444444
if (backend == BACKEND_SLEEF) {
445445
bool is_sign_preserved = (quad_signbit(&in_val->sleef_value) == quad_signbit(&roundtrip.sleef_value));
446-
if (Sleef_iunordq1(in_val->sleef_value, roundtrip.sleef_value) && is_sign_preserved)
446+
if(quad_isnan(&in_val->sleef_value) && quad_isnan(&roundtrip.sleef_value) && is_sign_preserved)
447447
return 1;
448448
if (Sleef_icmpeqq1(in_val->sleef_value, roundtrip.sleef_value) && is_sign_preserved)
449449
return 1;

0 commit comments

Comments
 (0)