Skip to content

Add callback mechanism so that array_finalize can see if obj is Numba meminfo. #214

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

Merged
merged 3 commits into from
Dec 11, 2020

Conversation

DrTodd13
Copy link
Contributor

I was not able to monkeypatch sycl__usm_array_interface into Numba's MemInfoObj as that object appears not to be monkeypatchable. Instead, I added a callback mechanism so that numba_dppy can register the previous code we had in array_finalize to check for USM MemInfo's. This way, we still have the same code but without Numba occurring explicitly in dpctl.

…mba_dppy.numpy_usm_shared can register with dpctl.dptensor.numpy_usm_shared.ndarray a callback function to look and see if the object is a Numba MemInfo with USM allocator.
Copy link
Contributor

@PokhodenkoSA PokhodenkoSA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
As I understand there is commit in IntelPython/numba-dpex#50 on side of numba-dppy to add checker to the list of checkers via add_external_usm_checker().
Tested locally on Linux - works fine.

@PokhodenkoSA
Copy link
Contributor

No tests for add_external_usm_checker().

@PokhodenkoSA PokhodenkoSA merged commit 1d38c5c into master Dec 11, 2020
@DrTodd13 DrTodd13 deleted the add_usm_checker_callbacks branch December 11, 2020 16:34
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