Skip to content

Commit

Permalink
Temporary driver for testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Diptorup Deb committed Nov 3, 2023
1 parent 2930c6e commit c2bed32
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions driver.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import dpctl
import dpnp

import numba_dpex.experimental as nd_exp
from numba_dpex import Range, dpjit


@nd_exp.kernel
def test_atomic_ref(a, b):
# i = get_global_id(0)
v = nd_exp.AtomicRef(
b,
nd_exp.MemoryOrder.relaxed,
nd_exp.MemoryScope.device,
nd_exp.AddressSpace.GLOBAL,
)
v.fetch_add(a[0]) # a[i]


q = dpctl.SyclQueue()
a = dpnp.ones(10, sycl_queue=q, dtype=dpnp.int64)
b = dpnp.array(0, sycl_queue=q, dtype=dpnp.int64)

nd_exp.call_kernel(test_atomic_ref, Range(10), a, b)
print(b)

0 comments on commit c2bed32

Please sign in to comment.