Skip to content

Commit

Permalink
Merge branch 'IntelPython:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
adarshyoga authored Feb 8, 2024
2 parents 8a63d5d + 8972feb commit 32ccc67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 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
5 changes: 3 additions & 2 deletions dpbench/benchmarks/l2_norm/l2_norm_numba_dpex_k.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
#
# SPDX-License-Identifier: Apache-2.0

import math

import numba_dpex as dpex
import numpy as np


@dpex.kernel
Expand All @@ -13,7 +14,7 @@ def l2_norm_kernel(a, d):
d[i] = 0.0
for k in range(a_rows):
d[i] += a[i, k] * a[i, k]
d[i] = np.sqrt(d[i])
d[i] = math.sqrt(d[i])


def l2_norm(a, d):
Expand Down

0 comments on commit 32ccc67

Please sign in to comment.