Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 2 additions & 0 deletions dpbench/benchmarks/default/gpairs/gpairs_dpnp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 2 additions & 0 deletions dpbench/benchmarks/default/l2_norm/l2_norm_dpnp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 2 additions & 0 deletions dpbench/benchmarks/default/rambo/rambo_dpnp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion environments/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ dependencies:
- numba
- dpctl
- dpnp
- numba-dpex>=0.23.0*
- numba-dpex>=0.23.0*