Skip to content

Random number generation routines do not support device= keyword argument #1260

Closed
@samaid

Description

@samaid
    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)

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions