Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fully enable DpctlSyclQueue handling in USMNdArray creation #1022

Conversation

chudur-budur
Copy link
Contributor

@chudur-budur chudur-budur commented Apr 26, 2023

It's a follow-up PR of #1007. This fully implements the support of dpctl.SyclQueue() in @dpjit so that

  • A SYCL queue doesn't need to be created every time when memory allocation happens.
  • A single (or cahced) queue can be passed around.
  • Functions like alloc_empty_arrayobj() and intrinsics like _empty_nd_impl() can handle a queue that has been passed down.
  • For the same purpose, the memory allocation c interface function like DPEXRT_MemInfo_alloc() in _dpexrt_python.c takes queue as an argument.

Testing code:

import dpctl
import dpnp
from numba_dpex import dpjit

@dpjit
def func(q1, q2):
    c = dpnp.empty(1, sycl_queue=q1)
    d = dpnp.zeros(1, sycl_queue=q2)
    return c, d

queue1 = dpctl.SyclQueue()
queue2 = dpctl.SyclQueue()
a, b = func(queue1, queue2)
print(a)
print(b)
  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • If this PR is a work in progress, are you filing the PR as a draft?

@chudur-budur chudur-budur changed the title Feature/usmndarray fully enable sycl queue Fully enable DpctlSyclQueue handling in USMNdArray creation Apr 26, 2023
@chudur-budur chudur-budur force-pushed the feature/usmndarray-fully-enable-sycl-queue branch from d7f31fb to c40bd83 Compare May 3, 2023 23:02
@chudur-budur chudur-budur marked this pull request as ready for review May 4, 2023 22:15
@chudur-budur chudur-budur requested a review from diptorupd as a code owner May 4, 2023 22:15
numba_dpex/_patches.py Outdated Show resolved Hide resolved
numba_dpex/_patches.py Outdated Show resolved Hide resolved
numba_dpex/_patches.py Outdated Show resolved Hide resolved
numba_dpex/_patches.py Outdated Show resolved Hide resolved
numba_dpex/_patches.py Outdated Show resolved Hide resolved
numba_dpex/core/runtime/_dpexrt_python.c Outdated Show resolved Hide resolved
numba_dpex/core/runtime/_dpexrt_python.c Outdated Show resolved Hide resolved
numba_dpex/core/runtime/_dpexrt_python.c Outdated Show resolved Hide resolved
numba_dpex/core/runtime/context.py Outdated Show resolved Hide resolved
numba_dpex/dpnp_iface/_intrinsic.py Outdated Show resolved Hide resolved
@chudur-budur chudur-budur force-pushed the feature/usmndarray-fully-enable-sycl-queue branch 2 times, most recently from c0d5b0e to 8edc27e Compare May 6, 2023 01:25
numba_dpex/_patches.py Outdated Show resolved Hide resolved
numba_dpex/_patches.py Outdated Show resolved Hide resolved
@diptorupd diptorupd force-pushed the feature/usmndarray-fully-enable-sycl-queue branch 2 times, most recently from e6d3f02 to a02ed2c Compare May 7, 2023 01:21
@chudur-budur chudur-budur force-pushed the feature/usmndarray-fully-enable-sycl-queue branch from 4d3b9ce to d878f78 Compare May 7, 2023 21:16
@chudur-budur chudur-budur force-pushed the feature/usmndarray-fully-enable-sycl-queue branch from d878f78 to 20d4340 Compare May 7, 2023 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants