Skip to content

Commit 7b43f3b

Browse files
committed
fixing reduction redorderable issue
1 parent 22982a4 commit 7b43f3b

File tree

2 files changed

+59
-1
lines changed

2 files changed

+59
-1
lines changed

quaddtype/meson.build

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
project('numpy_quaddtype', 'c', 'cpp', default_options : ['cpp_std=c++17', 'b_pie=true'])
2+
3+
py_mod = import('python')
4+
py = py_mod.find_installation()
5+
6+
c = meson.get_compiler('c')
7+
8+
sleef_dep = c.find_library('sleef')
9+
sleefquad_dep = c.find_library('sleefquad')
10+
11+
incdir_numpy = run_command(py,
12+
[
13+
'-c',
14+
'import numpy; import os; print(os.path.relpath(numpy.get_include()))'
15+
],
16+
check: true
17+
).stdout().strip()
18+
19+
includes = include_directories(
20+
[
21+
incdir_numpy,
22+
'numpy_quaddtype/src',
23+
]
24+
)
25+
26+
srcs = [
27+
'numpy_quaddtype/src/casts.h',
28+
'numpy_quaddtype/src/casts.cpp',
29+
'numpy_quaddtype/src/scalar.h',
30+
'numpy_quaddtype/src/scalar.c',
31+
'numpy_quaddtype/src/dtype.h',
32+
'numpy_quaddtype/src/dtype.c',
33+
'numpy_quaddtype/src/quaddtype_main.c',
34+
'numpy_quaddtype/src/scalar_ops.h',
35+
'numpy_quaddtype/src/scalar_ops.cpp',
36+
'numpy_quaddtype/src/ops.hpp',
37+
'numpy_quaddtype/src/umath.h',
38+
'numpy_quaddtype/src/umath.cpp',
39+
'numpy_quaddtype/src/dragon4.h',
40+
'numpy_quaddtype/src/dragon4.c'
41+
]
42+
43+
py.install_sources(
44+
[
45+
'numpy_quaddtype/__init__.py',
46+
],
47+
subdir: 'numpy_quaddtype',
48+
pure: false
49+
)
50+
51+
py.extension_module('_quaddtype_main',
52+
srcs,
53+
c_args: ['-g', '-O0', '-lsleef', '-lsleefquad'],
54+
dependencies: [sleef_dep, sleefquad_dep],
55+
install: true,
56+
subdir: 'numpy_quaddtype',
57+
include_directories: includes
58+
)

quaddtype/numpy_quaddtype/src/umath.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ create_quad_binary_ufunc(PyObject *numpy, const char *ufunc_name)
415415
.nin = 2,
416416
.nout = 1,
417417
.casting = NPY_NO_CASTING,
418-
.flags = (NPY_ARRAYMETHOD_FLAGS)0,
418+
.flags = NPY_METH_IS_REORDERABLE,
419419
.dtypes = dtypes,
420420
.slots = slots,
421421
};

0 commit comments

Comments
 (0)