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

Fix a crash when calling take() for input array with non-integer values #771

Merged
merged 4 commits into from
Sep 9, 2022

Conversation

antonwolfy
Copy link
Collaborator

@antonwolfy antonwolfy commented Sep 6, 2022

DPNP map of kernel functions for take() was updated in scope of #1172: an input array of indices has to be of an integer type. For other types of indices data, DPNP backend function get_dpnp_function_ptr() will raise a runtime exception pointing on the types mismatching.
Numba-DPEX had missing "except +" notation while declaring get_dpnp_function_ptr() in cython file. Thus the exception from DPNP backend led to a core dump in Numba-DPEX instead of printing the error.

Numba-DPEX shall explicitly pass a type of input array for indices while calling DPNP backend, rather than passing "None". It will help to select a proper kernel function, since DPNP has to know how incoming array is placed in the memory to avoid any potential memory corruption issue while accessing it.

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

@oleksandr-pavlyk oleksandr-pavlyk mentioned this pull request Sep 9, 2022
1 task
@diptorupd diptorupd merged commit 67450da into IntelPython:main Sep 9, 2022
@antonwolfy antonwolfy deleted the fix_take_crash branch September 12, 2022 08:20
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.

2 participants