From b2c21123bb40571caca3f24af57ab864ce37eb15 Mon Sep 17 00:00:00 2001 From: vchamarthi Date: Thu, 30 Apr 2026 19:52:30 -0500 Subject: [PATCH] Dpnp-fixes: update dpnp submodule call erf, synchronize array creation with dpnp --- .../benchmarks/default/black_scholes/black_scholes_dpnp.py | 6 ++++-- dpbench/benchmarks/default/gpairs/gpairs_dpnp.py | 2 ++ dpbench/benchmarks/default/l2_norm/l2_norm_dpnp.py | 2 ++ .../default/pairwise_distance/pairwise_distance_dpnp.py | 2 ++ dpbench/benchmarks/default/rambo/rambo_dpnp.py | 2 ++ environments/conda.yml | 2 +- 6 files changed, 13 insertions(+), 3 deletions(-) diff --git a/dpbench/benchmarks/default/black_scholes/black_scholes_dpnp.py b/dpbench/benchmarks/default/black_scholes/black_scholes_dpnp.py index 922baab8..35c10179 100644 --- a/dpbench/benchmarks/default/black_scholes/black_scholes_dpnp.py +++ b/dpbench/benchmarks/default/black_scholes/black_scholes_dpnp.py @@ -23,10 +23,12 @@ def black_scholes(nopt, price, strike, t, rate, volatility, call, put): w1 = (a - b + c) * y w2 = (a - b - c) * y - d1 = 0.5 + 0.5 * np.erf(w1) - d2 = 0.5 + 0.5 * np.erf(w2) + d1 = 0.5 + 0.5 * np.scipy.special.erf(w1) + d2 = 0.5 + 0.5 * np.scipy.special.erf(w2) Se = np.exp(b) * S call[:] = P * d1 - Se * d2 put[:] = call - P + Se + + np.synchronize_array_data(put) diff --git a/dpbench/benchmarks/default/gpairs/gpairs_dpnp.py b/dpbench/benchmarks/default/gpairs/gpairs_dpnp.py index 1731ec9c..a2d1c5b2 100644 --- a/dpbench/benchmarks/default/gpairs/gpairs_dpnp.py +++ b/dpbench/benchmarks/default/gpairs/gpairs_dpnp.py @@ -22,3 +22,5 @@ def _gpairs_impl(x1, y1, z1, w1, x2, y2, z2, w2, rbins): def gpairs(nopt, nbins, x1, y1, z1, w1, x2, y2, z2, w2, rbins, results): results[:] = _gpairs_impl(x1, y1, z1, w1, x2, y2, z2, w2, rbins) + + np.synchronize_array_data(results) diff --git a/dpbench/benchmarks/default/l2_norm/l2_norm_dpnp.py b/dpbench/benchmarks/default/l2_norm/l2_norm_dpnp.py index 4cdb3bc3..f46675fc 100644 --- a/dpbench/benchmarks/default/l2_norm/l2_norm_dpnp.py +++ b/dpbench/benchmarks/default/l2_norm/l2_norm_dpnp.py @@ -9,3 +9,5 @@ def l2_norm(a, d): sq = np.square(a) sum = sq.sum(axis=1, dtype=sq.dtype) d[:] = np.sqrt(sum) + + np.synchronize_array_data(d) diff --git a/dpbench/benchmarks/default/pairwise_distance/pairwise_distance_dpnp.py b/dpbench/benchmarks/default/pairwise_distance/pairwise_distance_dpnp.py index e9a64c22..8e7be82c 100644 --- a/dpbench/benchmarks/default/pairwise_distance/pairwise_distance_dpnp.py +++ b/dpbench/benchmarks/default/pairwise_distance/pairwise_distance_dpnp.py @@ -14,3 +14,5 @@ def pairwise_distance(X1, X2, D): np.add(D, x3, D) np.add(D, x2, D) np.sqrt(D, D) + + np.synchronize_array_data(D) diff --git a/dpbench/benchmarks/default/rambo/rambo_dpnp.py b/dpbench/benchmarks/default/rambo/rambo_dpnp.py index 542f95ca..925fdcc3 100644 --- a/dpbench/benchmarks/default/rambo/rambo_dpnp.py +++ b/dpbench/benchmarks/default/rambo/rambo_dpnp.py @@ -15,3 +15,5 @@ def rambo(nevts, nout, C1, F1, Q1, output): output[:, :, 1] = Q * S * np.sin(F) output[:, :, 2] = Q * S * np.cos(F) output[:, :, 3] = Q * C + + np.synchronize_array_data(output) diff --git a/environments/conda.yml b/environments/conda.yml index fd1cc797..1a0465d9 100644 --- a/environments/conda.yml +++ b/environments/conda.yml @@ -23,4 +23,4 @@ dependencies: - numba - dpctl - dpnp - - numba-dpex>=0.23.0* + - numba-dpex>=0.23.0* \ No newline at end of file