Skip to content

Commit

Permalink
change private arrays to use new dpex api
Browse files Browse the repository at this point in the history
  • Loading branch information
adarshyoga committed Apr 12, 2024
1 parent 2fb19c0 commit 1312b03
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions dpbench/benchmarks/default/gpairs/gpairs_numba_dpex_k.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ def count_weighted_pairs_3d_intel_no_slm_ker(

n_wi = 32

dsq_mat = dpex.private.array(shape=(32 * 32), dtype=dtype)
w0_vec = dpex.private.array(shape=(32), dtype=dtype)
w1_vec = dpex.private.array(shape=(32), dtype=dtype)
dsq_mat = kapi.PrivateArray(shape=(32 * 32), dtype=dtype)
w0_vec = kapi.PrivateArray(shape=(32), dtype=dtype)
w1_vec = kapi.PrivateArray(shape=(32), dtype=dtype)

offset0 = gr0 * n_wi * lws0 + lid0
offset1 = gr1 * n_wi * lws1 + lid1
Expand Down Expand Up @@ -80,7 +80,7 @@ def count_weighted_pairs_3d_intel_no_slm_ker(

# update slm_hist. Use work-item private buffer of 16 tfloat elements
for k in range(0, slm_hist_size, private_hist_size):
private_hist = dpex.private.array(shape=(32), dtype=dtype)
private_hist = kapi.PrivateArray(shape=(32), dtype=dtype)
for p in range(private_hist_size):
private_hist[p] = 0.0

Expand Down
4 changes: 2 additions & 2 deletions dpbench/benchmarks/default/kmeans/kmeans_numba_dpex_k.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def groupByCluster(
for i in range(WorkPI):
point_id = grid * WorkPI * local_size + i * local_size + lid
if point_id < numpoints:
localP = dpex.private.array(dims, dtyp)
localP = kapi.PrivateArray(dims, dtyp)
for d in range(dims):
localP[d] = arrayP[point_id, d]

Expand Down Expand Up @@ -179,7 +179,7 @@ def updateLabels(
for i in range(WorkPI):
point_id = grid * WorkPI * local_size + i * local_size + lid
if point_id < numpoints:
localP = dpex.private.array(dims, dtyp)
localP = kapi.PrivateArray(dims, dtyp)
for d in range(dims):
localP[d] = arrayP[point_id, d]

Expand Down
2 changes: 1 addition & 1 deletion dpbench/benchmarks/default/knn/knn_numba_dpex_k.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def _knn_kernel( # noqa: C901: TODO: can we simplify logic?
dtype = train.dtype
i = item.get_id(0)
# here k has to be 5 in order to match with numpy
queue_neighbors = dpex.private.array(shape=(5, 2), dtype=dtype)
queue_neighbors = kapi.PrivateArray(shape=(5, 2), dtype=dtype)

for j in range(k):
x1 = train[j]
Expand Down

0 comments on commit 1312b03

Please sign in to comment.