Skip to content

Fixed bug in dpctl.tensor.arange, streamlined tests #842

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 19, 2022

Conversation

oleksandr-pavlyk
Copy link
Contributor

While modifying tests to use dpctl.tensor.arange I encountered exception when starting value was outside of the range of the elemental data-type, e.g. dpctl.tensor.arange(128, 0, -1, dtype='i1').

This PR fixes the issue by coercing the starting point to the elemental data-type scalar.
A test of arange was modified to cover such input.

Tests in test_sycl_event and test_sycl_kernel_submit were modified to use dpctl.tensor.arange as opposed to using numpy.arange and copying the content into a MemoryUSMShared allocation.

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

A bug would manifest itself if the starting value is outside of
range of the array data type.

Fixed it by coercing the starting value to the data type, like
is currently done for the increment.

The test was modified to cover such an input.
@github-actions
Copy link

@coveralls
Copy link
Collaborator

Coverage Status

Coverage increased (+0.002%) to 82.876% when pulling d7fdf41 on use_dpctl_tensor_in_queue_submit_tests into 2522187 on master.

@oleksandr-pavlyk oleksandr-pavlyk merged commit 3664a3a into master May 19, 2022
@github-actions
Copy link

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

@oleksandr-pavlyk oleksandr-pavlyk deleted the use_dpctl_tensor_in_queue_submit_tests branch May 21, 2022 17:05
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