Closed
Description
import dpnp as np
n = 50000
x = np.random.random(n, device='gpu') # Random numbers generated on the default GPU device
y = np.random.random(n, device='gpu') # Random numbers generated on the default GPU device
acc = np.count_nonzero(x * x + y * y <= 1.0)
print("Magic Pi with numpy:", 4.0 * acc / n)