-
Notifications
You must be signed in to change notification settings - Fork 33
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
Adds boxing and unboxing functionality for dpnp.ndarray to numba_dpex #902
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diptorupd
force-pushed
the
feature/dpnp_ndarray/box-unbox
branch
5 times, most recently
from
February 6, 2023 03:22
38083f2
to
14e6d52
Compare
diptorupd
force-pushed
the
feature/dpnp_ndarray/box-unbox
branch
3 times, most recently
from
February 13, 2023 05:05
cad9c02
to
d8dd46d
Compare
- Made all args to the constructor except ndim as optional. - If no queue or device is provided then select a default queue using dpctl. - Select a default dtype using the same logic as dpctl.tensor. - Bugfix: make sure the derived dtype is passed to the parent Array type's constuctor. - Fix tests and examples impacted by UsmNdArray type changes. - Skip all dpnp.empty tests for now. These tests will be changed once the new implementation for dpnp.empty is merged.
- Adds a Numba type to represent dpctl.SyclQueue and infer it as an opaque pointer inside the compiler.
diptorupd
force-pushed
the
feature/dpnp_ndarray/box-unbox
branch
from
February 14, 2023 03:22
3960fc3
to
19e9b85
Compare
- Copy over needed headers and private functions from Numba's nrt_python extesion. - Adds a boxing function for dpnp.ndarrays. - takes a Numba native arystruct object and creates a dpctl.tensor.usm_ndarray object and then a dpnp.ndarray PyObject and returns it. - If the arystruct object had a Numba allocated meminfo pointer, the dpctl.tensor.usm_ndarray uses the meminfo object as its base pointer. - If the arystruct object had a parent pointer, i.e., it was created from an externally passed dpnp.ndarray PyObject, returns the parent back instead of creating a new dpnp.ndarray.
- Adds an unboxing helper function to the _dpexrt_python.c for dpnp.ndarray. - Implements helper functions to create and destroy an NRT_ExternalAllocator object that uses usm allocators.
- Adds a function to allocate a NRT_MemInfo object's data pointer using USM allocators.
- Adds helpers to generate C calls to dpexrt_python native functions directly inside LLVM IR. - Registers the helper function in _dpexrt_python so that we can insert calls to them via llvmlite.
- Removes the numba_dpex/core/dpnp_ndarray modules - Adds an arrayobj submodule to numba_dpex/dpnp_iface - Implements boxing and unboxing for dpnp.ndarrays using _dpexrt_python extension. - Adds an overload for dpnp.empty to dono_iface/arrayobj.
- Implement refresh and a dpex target registry. - Initialize the dpjit dispacther and runtime sub-modules when dpex loads. - doxstrings etc.
diptorupd
force-pushed
the
feature/dpnp_ndarray/box-unbox
branch
from
February 14, 2023 03:25
19e9b85
to
253be29
Compare
Added runtime tests.
diptorupd
force-pushed
the
feature/dpnp_ndarray/box-unbox
branch
2 times, most recently
from
February 15, 2023 03:37
25ebd55
to
b554084
Compare
mingjie-intel
approved these changes
Feb 16, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
- Set PyErr_SetString before returning NULL from DPEXRT_sycl_usm_ndarray_to_python_acqref. - Add few extra NULL checks. - Remove debug prints. - Add NRT_debug wrappers to debug prints.
diptorupd
force-pushed
the
feature/dpnp_ndarray/box-unbox
branch
from
February 16, 2023 07:07
ac144f0
to
70e93bc
Compare
github-actions bot
added a commit
that referenced
this pull request
Feb 16, 2023
Adds boxing and unboxing functionality for dpnp.ndarray to numba_dpex bf10086
This was referenced Feb 16, 2023
20 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The PR implements the boxing and unboxing routines for a
dpnp.ndarray
to numba_dpex.