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

Device-aware can_cast and result_type #1488

Merged
merged 3 commits into from
Dec 17, 2023

Conversation

oleksandr-pavlyk
Copy link
Collaborator

Changed dpt.can_cast and dpt.result_type to be device-aware if arguments are instances of usm_ndarray.

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

Implementation uses device-specific type promotion rules if input
are arrays.

For result_type, all arrays must have the same dtype support, or
an exception is raused.
Copy link

@coveralls
Copy link
Collaborator

coveralls commented Dec 15, 2023

Coverage Status

coverage: 89.693% (+0.05%) from 89.644%
when pulling e6bc9f2 on device-are-can_cast_and_result_type
into bb5ff39 on master.

Copy link

Array API standard conformance tests for dpctl=0.15.1dev2=py310h15de555_50 ran successfully.
Passed: 877
Failed: 55
Skipped: 59

@oleksandr-pavlyk oleksandr-pavlyk changed the title Device are can cast and result type Device aware can cast and result type Dec 16, 2023
@oleksandr-pavlyk oleksandr-pavlyk changed the title Device aware can cast and result type Device-aware can_cast and result_type Dec 16, 2023
Copy link
Collaborator

@ndgrigorian ndgrigorian left a comment

Choose a reason for hiding this comment

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

@oleksandr-pavlyk
This PR supersedes 1053, correct?

LGTM with the coverage improvement!

@oleksandr-pavlyk
Copy link
Collaborator Author

Yes, this supersedes gh-1053.

@oleksandr-pavlyk oleksandr-pavlyk merged commit cc693a4 into master Dec 17, 2023
37 of 49 checks passed
@oleksandr-pavlyk oleksandr-pavlyk deleted the device-are-can_cast_and_result_type branch December 17, 2023 03:59
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