diff options
| author | mattip <matti.picus@gmail.com> | 2019-03-10 15:03:36 +0200 |
|---|---|---|
| committer | mattip <matti.picus@gmail.com> | 2019-05-11 10:13:40 -0700 |
| commit | 8c4d4bb73e5bd69a7961a912fffc38c6a49d6bf2 (patch) | |
| tree | 2f414987f8bd1cbac70b995f603d2f0f32e4d0f0 /numpy | |
| parent | fa709605401b5acde6fa515239ba29a548c53755 (diff) | |
| download | numpy-8c4d4bb73e5bd69a7961a912fffc38c6a49d6bf2.tar.gz | |
BUG: fix for big-endian systems
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/core/src/multiarray/compiled_base.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/numpy/core/src/multiarray/compiled_base.c b/numpy/core/src/multiarray/compiled_base.c index 046a9eda1..db7813233 100644 --- a/numpy/core/src/multiarray/compiled_base.c +++ b/numpy/core/src/multiarray/compiled_base.c @@ -1827,13 +1827,22 @@ unpack_bits(PyObject *input, int axis, PyObject *count_obj, char order) in_stride = PyArray_STRIDE(new, axis); out_stride = PyArray_STRIDE(out, axis); + +#if NPY_BYTE_ORDER == NPY_LITTLE_ENDIAN + if (order == 'l') { + unpack_lookup = &unpack_lookup_l; + } + else { + unpack_lookup = &unpack_lookup_b; + } +#else if (order == 'l') { - unpack_lookup = &unpack_lookup_l; + unpack_lookup = &unpack_lookup_b; } else { - unpack_lookup = &unpack_lookup_b; + unpack_lookup = &unpack_lookup_l; } - +#endif NPY_BEGIN_THREADS_THRESHOLDED(PyArray_Size((PyObject *)out) / 8); while (PyArray_ITER_NOTDONE(it)) { |
