Skip to content

Commit 642219f

Browse files
Merge pull request #5238 from meeseeksmachine/auto-backport-of-pr-5237-on-yt-4.4.x
Backport PR #5237 on branch yt-4.4.x (BLD/PERF: add missing `noexcept` qualifiers to Cython functions already declared as `nogil`)
2 parents 302fe07 + 98147f0 commit 642219f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

yt/geometry/grid_visitors.pyx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ from yt.utilities.lib.bitarray cimport ba_set_value
1717
from yt.utilities.lib.fp_utils cimport iclip
1818

1919

20-
cdef void free_tuples(GridVisitorData *data) nogil:
20+
cdef void free_tuples(GridVisitorData *data) noexcept nogil:
2121
# This wipes out the tuples, which is necessary since they are
2222
# heap-allocated
2323
cdef int i
@@ -31,7 +31,7 @@ cdef void free_tuples(GridVisitorData *data) nogil:
3131
@cython.boundscheck(False)
3232
@cython.wraparound(False)
3333
@cython.cdivision(True)
34-
cdef void setup_tuples(GridVisitorData *data) nogil:
34+
cdef void setup_tuples(GridVisitorData *data) noexcept nogil:
3535
# This sets up child-mask tuples. Rather than a single mask that covers
3636
# everything, we instead allocate pairs of integers that are start/stop
3737
# positions for child masks. This may not be considerably more efficient
@@ -58,7 +58,7 @@ cdef void setup_tuples(GridVisitorData *data) nogil:
5858
@cython.boundscheck(False)
5959
@cython.wraparound(False)
6060
@cython.cdivision(True)
61-
cdef np.uint8_t check_child_masked(GridVisitorData *data) nogil:
61+
cdef np.uint8_t check_child_masked(GridVisitorData *data) noexcept nogil:
6262
# This simply checks if we're inside any of the tuples. Probably not the
6363
# most efficient way, but the GVD* passed in has a position affiliated with
6464
# it, and we can very easily look for that inside here.
@@ -80,7 +80,7 @@ cdef np.uint8_t check_child_masked(GridVisitorData *data) nogil:
8080
@cython.boundscheck(False)
8181
@cython.wraparound(False)
8282
@cython.cdivision(True)
83-
cdef void count_cells(GridVisitorData *data, np.uint8_t selected) nogil:
83+
cdef void count_cells(GridVisitorData *data, np.uint8_t selected) noexcept nogil:
8484
# Simply increment for each one, if we've selected it.
8585
if selected == 0: return
8686
cdef np.uint64_t *count = <np.uint64_t*> data.array
@@ -89,7 +89,7 @@ cdef void count_cells(GridVisitorData *data, np.uint8_t selected) nogil:
8989
@cython.boundscheck(False)
9090
@cython.wraparound(False)
9191
@cython.cdivision(True)
92-
cdef void mask_cells(GridVisitorData *data, np.uint8_t selected) nogil:
92+
cdef void mask_cells(GridVisitorData *data, np.uint8_t selected) noexcept nogil:
9393
# Set our bitarray -- we're creating a mask -- if we are selected.
9494
if selected == 0: return
9595
cdef np.uint8_t *mask = <np.uint8_t*> data.array
@@ -99,7 +99,7 @@ cdef void mask_cells(GridVisitorData *data, np.uint8_t selected) nogil:
9999
@cython.boundscheck(False)
100100
@cython.wraparound(False)
101101
@cython.cdivision(True)
102-
cdef void icoords_cells(GridVisitorData *data, np.uint8_t selected) nogil:
102+
cdef void icoords_cells(GridVisitorData *data, np.uint8_t selected) noexcept nogil:
103103
# Nice and easy icoord setter.
104104
if selected == 0: return
105105
cdef int i
@@ -111,7 +111,7 @@ cdef void icoords_cells(GridVisitorData *data, np.uint8_t selected) nogil:
111111
@cython.boundscheck(False)
112112
@cython.wraparound(False)
113113
@cython.cdivision(True)
114-
cdef void ires_cells(GridVisitorData *data, np.uint8_t selected) nogil:
114+
cdef void ires_cells(GridVisitorData *data, np.uint8_t selected) noexcept nogil:
115115
# Fill with the level value.
116116
if selected == 0: return
117117
cdef np.int64_t *ires = <np.int64_t*> data.array
@@ -121,7 +121,7 @@ cdef void ires_cells(GridVisitorData *data, np.uint8_t selected) nogil:
121121
@cython.boundscheck(False)
122122
@cython.wraparound(False)
123123
@cython.cdivision(True)
124-
cdef void fwidth_cells(GridVisitorData *data, np.uint8_t selected) nogil:
124+
cdef void fwidth_cells(GridVisitorData *data, np.uint8_t selected) noexcept nogil:
125125
# Fill with our dds.
126126
if selected == 0: return
127127
cdef int i
@@ -133,7 +133,7 @@ cdef void fwidth_cells(GridVisitorData *data, np.uint8_t selected) nogil:
133133
@cython.boundscheck(False)
134134
@cython.wraparound(False)
135135
@cython.cdivision(True)
136-
cdef void fcoords_cells(GridVisitorData *data, np.uint8_t selected) nogil:
136+
cdef void fcoords_cells(GridVisitorData *data, np.uint8_t selected) noexcept nogil:
137137
# Simple cell-centered position filling.
138138
if selected == 0: return
139139
cdef int i

0 commit comments

Comments
 (0)