From 1312b039077df08d93aa2fabc40e809c1b893f45 Mon Sep 17 00:00:00 2001 From: Adarsh Yoga Date: Fri, 12 Apr 2024 16:02:15 -0500 Subject: [PATCH] change private arrays to use new dpex api --- dpbench/benchmarks/default/gpairs/gpairs_numba_dpex_k.py | 8 ++++---- dpbench/benchmarks/default/kmeans/kmeans_numba_dpex_k.py | 4 ++-- dpbench/benchmarks/default/knn/knn_numba_dpex_k.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dpbench/benchmarks/default/gpairs/gpairs_numba_dpex_k.py b/dpbench/benchmarks/default/gpairs/gpairs_numba_dpex_k.py index 52034cef..f5a72b00 100644 --- a/dpbench/benchmarks/default/gpairs/gpairs_numba_dpex_k.py +++ b/dpbench/benchmarks/default/gpairs/gpairs_numba_dpex_k.py @@ -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 @@ -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 diff --git a/dpbench/benchmarks/default/kmeans/kmeans_numba_dpex_k.py b/dpbench/benchmarks/default/kmeans/kmeans_numba_dpex_k.py index 6bac670c..c89b6b8d 100644 --- a/dpbench/benchmarks/default/kmeans/kmeans_numba_dpex_k.py +++ b/dpbench/benchmarks/default/kmeans/kmeans_numba_dpex_k.py @@ -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] @@ -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] diff --git a/dpbench/benchmarks/default/knn/knn_numba_dpex_k.py b/dpbench/benchmarks/default/knn/knn_numba_dpex_k.py index 8771efa6..4ec82875 100644 --- a/dpbench/benchmarks/default/knn/knn_numba_dpex_k.py +++ b/dpbench/benchmarks/default/knn/knn_numba_dpex_k.py @@ -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]