Skip to content

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

Merged
ndgrigorian merged 2 commits into
masterfrom
fix-strided-searchsorted-scalar-needle
May 22, 2024
Merged

ndgrigorian merged 2 commits into
masterfrom
fix-strided-searchsorted-scalar-needle

Conversation

@ndgrigorian

Copy link
Copy Markdown
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?

@oleksandr-pavlyk oleksandr-pavlyk left a comment

Copy link
Copy Markdown
Contributor

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
@github-actions

github-actions Bot commented May 22, 2024 •

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown

Array API standard conformance tests for dpctl=0.18.0dev0=py310h15de555_11 ran successfully.
Passed: 889
Failed: 16
Skipped: 91

@coveralls

Copy link
Copy Markdown
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
@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