From c2bed3278f441aeb680036c3c483164ac9d0424a Mon Sep 17 00:00:00 2001 From: Diptorup Deb Date: Thu, 2 Nov 2023 18:09:01 -0500 Subject: [PATCH] Temporary driver for testing. --- driver.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 driver.py diff --git a/driver.py b/driver.py new file mode 100644 index 0000000000..4da67e7bdb --- /dev/null +++ b/driver.py @@ -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)