• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IntelPython / dpnp / 46469832074
85%

Build:
DEFAULT BRANCH: master
Ran 30 Nov 2026 06:09PM UTC
Jobs 1
Files 274
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

30 Nov 2026 05:07PM UTC coverage: 84.559% (+0.003%) from 84.556%
46469832074

push

github

web-flow
Fix copying 0-d and non-contiguous host arrays to a device in `from_dlpack` (#3207)

This PR fixes a `ValueError` in `dpnp.from_dlpack` and
`dpnp.tensor.from_dlpack` when copying a 0-d or non-C-contiguous host
array to a SYCL device.

When the producer cannot export to the requested oneAPI device, as NumPy
cannot, `from_dlpack` imports the array on the host and copies it to the
device with `_to_usm_ary_from_host_blob`. That helper took a `uint8`
view of the host array before flattening it, and NumPy refuses a view to
a smaller itemsize on a 0-d array (`Changing the dtype of a 0d array is
only supported if the itemsize is unchanged`) or on an array whose last
axis is not contiguous (`To change to a dtype of a different size, the
last axis must be contiguous`). Only arrays with one-byte items, such as
`bool`, got through. The array is now made C-contiguous, and at least
1-d, before the view.

The 0-d case is the round trip scikit-learn makes for Array API inputs:
it moves an array to the host with `numpy.from_dlpack(x, device="cpu")`
and back with `xp.from_dlpack(y, device=device)`. The first direction
already worked.

`test_ndim0_host_round_trip` makes both calls for a 0-d array of every
dtype, and `test_copy_via_host_layouts` copies 0-d, strided, reversed
and F-contiguous host arrays to the device with
`dpnp.tensor.from_dlpack`. Without the fix, every case of both tests
fails except `bool`.

- [x] Have you provided a meaningful PR description?
- [x] Have you added a test, reproducer or referred to an issue with a
reproducer?
- [x] Have you tested your changes locally for CPU and GPU devices?
- [x] Have you made sure that new changes do not introduce compiler
warnings?
- [ ] Have you checked performance impact of proposed changes?
- [ ] Have you added documentation for your changes, if necessary?
- [x] Have you added your changes to the changelog?

1906 of 3156 branches covered (60.39%)

Branch coverage included in aggregate %.

2 of 2 new or added lines in 1 file covered. (100.0%)

30815 of 35540 relevant lines covered (86.71%)

39392.16 hits per line

Jobs
ID Job ID Ran Files Coverage
1 46469832074.1 30 Nov 2026 06:09PM UTC 274
84.56
GitHub Action Run
Source Files on build 46469832074
  • Tree
  • List 274
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #46469832074
  • 4c834173 on github
  • Prev Build on master (#46252162109)
  • Next Build on master (#46488233583)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc