Skip to content

MAINT PairwiseDistancesReduction: GEMMTermComputer._compute_dist{ances_on_chunks→_middle_terms} #24626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ cdef class EuclideanArgKmin{{name_suffix}}(ArgKmin{{name_suffix}}):
DTYPE_t squared_dist_i_j
ITYPE_t n_X = X_end - X_start
ITYPE_t n_Y = Y_end - Y_start
DTYPE_t * dist_middle_terms = self.gemm_term_computer._compute_distances_on_chunks(
DTYPE_t * dist_middle_terms = self.gemm_term_computer._compute_dist_middle_terms(
X_start, X_end, Y_start, Y_end, thread_num
)
DTYPE_t * heaps_r_distances = self.heaps_r_distances_chunks[thread_num]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ cdef class GEMMTermComputer{{name_suffix}}:
ITYPE_t thread_num
) nogil

cdef DTYPE_t * _compute_distances_on_chunks(
cdef DTYPE_t * _compute_dist_middle_terms(
self,
ITYPE_t X_start,
ITYPE_t X_end,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ from ...utils._cython_blas cimport (
{{for name_suffix, upcast_to_float64, INPUT_DTYPE_t, INPUT_DTYPE in implementation_specific_values}}

cdef class GEMMTermComputer{{name_suffix}}:
"""Component for `FastEuclidean*` variant wrapping the logic for the call to GEMM.
"""Component for `EuclideanDistance` specialisation wrapping the logic for the call to GEMM.

`FastEuclidean*` classes internally compute the squared Euclidean distances between
chunks of vectors X_c and Y_c using the following decomposition:
`EuclideanDistance` subclasses internally compute the squared Euclidean distances
between chunks of vectors X_c and Y_c using the following decomposition:


||X_c_i - Y_c_j||² = ||X_c_i||² - 2 X_c_i.Y_c_j^T + ||Y_c_j||²
Expand Down Expand Up @@ -167,7 +167,7 @@ cdef class GEMMTermComputer{{name_suffix}}:
return
{{endif}}

cdef DTYPE_t * _compute_distances_on_chunks(
cdef DTYPE_t * _compute_dist_middle_terms(
self,
ITYPE_t X_start,
ITYPE_t X_end,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ cdef class EuclideanRadiusNeighbors{{name_suffix}}(RadiusNeighbors{{name_suffix}
DTYPE_t squared_dist_i_j
ITYPE_t n_X = X_end - X_start
ITYPE_t n_Y = Y_end - Y_start
DTYPE_t *dist_middle_terms = self.gemm_term_computer._compute_distances_on_chunks(
DTYPE_t *dist_middle_terms = self.gemm_term_computer._compute_dist_middle_terms(
X_start, X_end, Y_start, Y_end, thread_num
)

Expand Down