Skip to content

Propagate read-only flag from sycl_usm_array_interface in asarray #1756

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 4 commits into from
Jul 26, 2024

Conversation

oleksandr-pavlyk
Copy link
Contributor

Change to dpt.asarray to take read-only flag value from __sycl_usm_array_interface__ into account.

In [1]: import dpctl, dpctl.utils as du, dpctl.tensor as dpt, dpnp

In [2]: x = dpt.linspace(100, 0, num=101, dtype="f8")

In [3]: x.flags["W"] = False

In [4]: y = dpnp.asarray(x)

In [5]: z = dpt.asarray(y)

In [6]: z.flags
Out[6]:
  C_CONTIGUOUS : True
  F_CONTIGUOUS : True
  WRITABLE : False
  • 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?
  • Have you checked performance impact of proposed changes?
  • If this PR is a work in progress, are you opening the PR as a draft?

Copy link

github-actions bot commented Jul 24, 2024

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

Copy link

Array API standard conformance tests for dpctl=0.18.0dev0=py310ha798474_161 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

@coveralls
Copy link
Collaborator

coveralls commented Jul 24, 2024

Coverage Status

coverage: 87.96% (-0.005%) from 87.965%
when pulling 9a5715f on propagate-ro-flag-for-suai-in-asarray
into 7450558 on master.

Co-authored-by: Anton <100830759+antonwolfy@users.noreply.github.com>
Copy link

Array API standard conformance tests for dpctl=0.18.0dev0=py310ha798474_167 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

antonwolfy
antonwolfy previously approved these changes Jul 25, 2024
Copy link
Collaborator

@antonwolfy antonwolfy left a comment

Choose a reason for hiding this comment

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

All dpnp tests pass with that change. And no more review comments from me.
Thank you @oleksandr-pavlyk

Copy link

Array API standard conformance tests for dpctl=0.18.0dev0=py310ha798474_168 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

@oleksandr-pavlyk oleksandr-pavlyk merged commit 9403f76 into master Jul 26, 2024
38 of 49 checks passed
@oleksandr-pavlyk oleksandr-pavlyk deleted the propagate-ro-flag-for-suai-in-asarray branch July 26, 2024 11:50
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.

3 participants