Skip to content

Commit

Permalink
Merge pull request #25115 from charris/backport-25032
Browse files Browse the repository at this point in the history
MAINT: Add missing `noexcept` to shuffle helpers
  • Loading branch information
charris committed Nov 11, 2023
2 parents 1faa0f0 + c2f0c44 commit ea72d88
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions numpy/random/_generator.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ cdef int64_t _safe_sum_nonneg_int64(size_t num_colors, int64_t *colors):
cdef inline void _shuffle_raw_wrap(bitgen_t *bitgen, np.npy_intp n,
np.npy_intp first, np.npy_intp itemsize,
np.npy_intp stride,
char* data, char* buf) nogil:
char* data, char* buf) noexcept nogil:
# We trick gcc into providing a specialized implementation for
# the most common case, yielding a ~33% performance improvement.
# Note that apparently, only one branch can ever be specialized.
Expand All @@ -76,7 +76,7 @@ cdef inline void _shuffle_raw_wrap(bitgen_t *bitgen, np.npy_intp n,
cdef inline void _shuffle_raw(bitgen_t *bitgen, np.npy_intp n,
np.npy_intp first, np.npy_intp itemsize,
np.npy_intp stride,
char* data, char* buf) nogil:
char* data, char* buf) noexcept nogil:
"""
Parameters
----------
Expand Down Expand Up @@ -107,7 +107,7 @@ cdef inline void _shuffle_raw(bitgen_t *bitgen, np.npy_intp n,


cdef inline void _shuffle_int(bitgen_t *bitgen, np.npy_intp n,
np.npy_intp first, int64_t* data) nogil:
np.npy_intp first, int64_t* data) noexcept nogil:
"""
Parameters
----------
Expand Down

0 comments on commit ea72d88

Please sign in to comment.