Skip to content

Fix tensor.searchsorted for x1 with strides and scalar (0D) x2 #1693

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 2 commits into from
May 22, 2024

Conversation

ndgrigorian
Copy link
Collaborator

Closes #1689

This PR fixes dpctl.tensor.searchsorted for the case of an input array x1 with negative strides and a scalar (0D) array x2.

Previously, this case would raise RuntimeError.

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

@oleksandr-pavlyk oleksandr-pavlyk left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for finding and fixing the problem, @ndgrigorian

@oleksandr-pavlyk oleksandr-pavlyk changed the title Fix tensor.searchsorted for x1 with negative strides and scalar (0D) x2 Fix tensor.searchsorted for x1 with strides and scalar (0D) x2 May 22, 2024
Copy link

github-actions bot commented May 22, 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=py310h15de555_11 ran successfully.
Passed: 889
Failed: 16
Skipped: 91

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 87.943%. remained the same
when pulling 8c6a57e on fix-strided-searchsorted-scalar-needle
into 4dac76c on master.

@ndgrigorian ndgrigorian merged commit 65baa6d into master May 22, 2024
57 of 60 checks passed
@ndgrigorian ndgrigorian deleted the fix-strided-searchsorted-scalar-needle branch May 22, 2024 21:56
oleksandr-pavlyk pushed a commit that referenced this pull request May 23, 2024
…1693)

* Adds code to handle edge case of strided input and scalar `needle` in `searchsorted.cpp`

* Adds a test for fix to gh-1689
oleksandr-pavlyk added a commit that referenced this pull request May 23, 2024
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.

searchsorted raises RuntimeError: USM-host allocation failure
3 participants