Commit 1878560f authored by Julien Jerphanion's avatar Julien Jerphanion

Try using prange

prange can't be resolved, yet it is imported.
parent eea55685
...@@ -690,6 +690,7 @@ cdef cypclass KDTree: ...@@ -690,6 +690,7 @@ cdef cypclass KDTree:
I_t n_neighbors = knn_indices.shape[1] I_t n_neighbors = knn_indices.shape[1]
D_t * _query_points_ptr = <D_t *> query_points.data D_t * _query_points_ptr = <D_t *> query_points.data
D_t rdist_lower_bound D_t rdist_lower_bound
I_t num_threads = omp_get_max_threads()
NeighborsHeaps heaps = NeighborsHeaps( NeighborsHeaps heaps = NeighborsHeaps(
<I_t *> knn_indices.data, <I_t *> knn_indices.data,
...@@ -698,7 +699,7 @@ cdef cypclass KDTree: ...@@ -698,7 +699,7 @@ cdef cypclass KDTree:
n_neighbors n_neighbors
) )
for i in range(n_query): for i in prange(n_query, schedule='static', num_threads=num_threads):
rdist_lower_bound = self.min_rdist(0, _query_points_ptr + i * n_features) rdist_lower_bound = self.min_rdist(0, _query_points_ptr + i * n_features)
self._query_single_depthfirst(0, _query_points_ptr, i, heaps, rdist_lower_bound) self._query_single_depthfirst(0, _query_points_ptr, i, heaps, rdist_lower_bound)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment