Skip to content

Handle numpy arrays with usm memory underneath in dpctl.tensor.asarray #1117

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 1 commit into from
Mar 13, 2023

Conversation

oleksandr-pavlyk
Copy link
Contributor

Closes gh-1089

Hardened _copy_from_numpy_into to handle numpy.ndarray inputs with USMMemory buffer as a base.

Copy-with-casting kernel to transfer content of numpy.ndarray to usm_ndarray is implemented using sycl::buffer used on ndarray's data-pointer. The pointer can not be a host-accessible USM pointer for the behavior to be well-defined.

This change should fix gh-1089

  • 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?

…r underneath

Copy-with-casting kernel to transfer content of numpy.ndarray to usm_ndarray is
implemented using sycl::buffer used on ndarray's data-pointer. The pointer can
not be a host-accessible USM pointer for the behavior to be well-defined.

This change should fix issue gh-1089
@github-actions
Copy link

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.2=py310h76be34b_30 ran successfully.
Passed: 46
Failed: 788
Skipped: 280

@coveralls
Copy link
Collaborator

Coverage Status

Coverage: 82.427% (+0.02%) from 82.404% when pulling b1355d4 on fix-for-gh-1089 into 51863d4 on master.

@oleksandr-pavlyk oleksandr-pavlyk merged commit a91eaf3 into master Mar 13, 2023
@oleksandr-pavlyk oleksandr-pavlyk deleted the fix-for-gh-1089 branch March 13, 2023 21:43
@github-actions
Copy link

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.2=py310h76be34b_30 ran successfully.
Passed: 45
Failed: 789
Skipped: 280

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.

asarray() function returns RuntimeError: Native API failed.
4 participants