edsger 0.1.1__cp311-cp311-macosx_11_0_arm64.whl → 0.1.2__cp311-cp311-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- edsger/_version.py +1 -1
- edsger/commons.c +151 -147
- edsger/commons.cpython-311-darwin.so +0 -0
- edsger/dijkstra.c +1132 -1059
- edsger/dijkstra.cpython-311-darwin.so +0 -0
- edsger/dijkstra.pyx +23 -0
- edsger/path_tracking.c +151 -147
- edsger/path_tracking.cpython-311-darwin.so +0 -0
- edsger/path_tracking.pyx +2 -2
- edsger/pq_4ary_dec_0b.c +203 -199
- edsger/pq_4ary_dec_0b.cpython-311-darwin.so +0 -0
- edsger/pq_4ary_dec_0b.pxd +7 -7
- edsger/pq_4ary_dec_0b.pyx +14 -16
- edsger/prefetch_compat.h +21 -0
- edsger/spiess_florian.c +157 -176
- edsger/spiess_florian.cpython-311-darwin.so +0 -0
- edsger/star.c +151 -147
- edsger/star.cpython-311-darwin.so +0 -0
- edsger/star.pyx +3 -3
- {edsger-0.1.1.dist-info → edsger-0.1.2.dist-info}/METADATA +19 -12
- edsger-0.1.2.dist-info/RECORD +33 -0
- edsger-0.1.1.dist-info/RECORD +0 -32
- {edsger-0.1.1.dist-info → edsger-0.1.2.dist-info}/WHEEL +0 -0
- {edsger-0.1.1.dist-info → edsger-0.1.2.dist-info}/licenses/AUTHORS.rst +0 -0
- {edsger-0.1.1.dist-info → edsger-0.1.2.dist-info}/licenses/LICENSE +0 -0
- {edsger-0.1.1.dist-info → edsger-0.1.2.dist-info}/top_level.txt +0 -0
Binary file
|
edsger/dijkstra.pyx
CHANGED
@@ -23,6 +23,11 @@ from edsger.commons cimport (
|
|
23
23
|
DTYPE_INF, UNLABELED, SCANNED, DTYPE_t, ElementState)
|
24
24
|
cimport edsger.pq_4ary_dec_0b as pq # priority queue
|
25
25
|
|
26
|
+
# Memory prefetching support (x86/x64 only)
|
27
|
+
cdef extern from "prefetch_compat.h":
|
28
|
+
void prefetch_hint(char*, int) nogil
|
29
|
+
int PREFETCH_T0
|
30
|
+
|
26
31
|
|
27
32
|
cpdef cnp.ndarray compute_sssp(
|
28
33
|
cnp.uint32_t[::1] csr_indptr,
|
@@ -83,8 +88,17 @@ cpdef cnp.ndarray compute_sssp(
|
|
83
88
|
<size_t>csr_indptr[tail_vert_idx + 1]):
|
84
89
|
|
85
90
|
head_vert_idx = <size_t>csr_indices[idx]
|
91
|
+
|
92
|
+
# Prefetch next iteration data to improve cache performance
|
93
|
+
if idx + 1 < <size_t>csr_indptr[tail_vert_idx + 1]:
|
94
|
+
prefetch_hint(<char*>&csr_indices[idx + 1], PREFETCH_T0)
|
95
|
+
prefetch_hint(<char*>&csr_data[idx + 1], PREFETCH_T0)
|
96
|
+
|
86
97
|
vert_state = pqueue.Elements[head_vert_idx].state
|
87
98
|
if vert_state != SCANNED:
|
99
|
+
# Prefetch priority queue element data for the vertex
|
100
|
+
prefetch_hint(<char*>&pqueue.Elements[head_vert_idx], PREFETCH_T0)
|
101
|
+
|
88
102
|
head_vert_val = tail_vert_val + csr_data[idx]
|
89
103
|
if vert_state == UNLABELED:
|
90
104
|
pq.insert(&pqueue, head_vert_idx, head_vert_val)
|
@@ -164,8 +178,17 @@ cpdef cnp.ndarray compute_sssp_w_path(
|
|
164
178
|
<size_t>csr_indptr[tail_vert_idx + 1]):
|
165
179
|
|
166
180
|
head_vert_idx = <size_t>csr_indices[idx]
|
181
|
+
|
182
|
+
# Prefetch next iteration data to improve cache performance
|
183
|
+
if idx + 1 < <size_t>csr_indptr[tail_vert_idx + 1]:
|
184
|
+
prefetch_hint(<char*>&csr_indices[idx + 1], PREFETCH_T0)
|
185
|
+
prefetch_hint(<char*>&csr_data[idx + 1], PREFETCH_T0)
|
186
|
+
|
167
187
|
vert_state = pqueue.Elements[head_vert_idx].state
|
168
188
|
if vert_state != SCANNED:
|
189
|
+
# Prefetch priority queue element data for the vertex
|
190
|
+
prefetch_hint(<char*>&pqueue.Elements[head_vert_idx], PREFETCH_T0)
|
191
|
+
|
169
192
|
head_vert_val = tail_vert_val + csr_data[idx]
|
170
193
|
if vert_state == UNLABELED:
|
171
194
|
pq.insert(&pqueue, head_vert_idx, head_vert_val)
|