Skip to content

Commit

Permalink
Merge pull request #333 from IntelPython/fix/knn_failure
Browse files Browse the repository at this point in the history
Fix failure in knn kernel version
  • Loading branch information
Diptorup Deb authored Feb 7, 2024
2 parents 8b56970 + 233abbc commit 8972feb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dpbench/benchmarks/knn/knn_numba_dpex_k.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ def _knn_kernel( # noqa: C901: TODO: can we simplify logic?
distance += diff * diff
dist = sqrt(distance)

if dist < queue_neighbors[k - 1][0]:
queue_neighbors[k - 1][0] = dist
queue_neighbors[k - 1][1] = train_labels[j]
if dist < queue_neighbors[k - 1, 0]:
queue_neighbors[k - 1, 0] = dist
queue_neighbors[k - 1, 1] = train_labels[j]
new_distance = queue_neighbors[k - 1, 0]
new_neighbor_label = queue_neighbors[k - 1, 1]
index = k - 1
Expand Down

0 comments on commit 8972feb

Please sign in to comment.