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

IntelPython / dpnp / 46041987018
85%

Build:
DEFAULT BRANCH: master
Ran 27 Nov 2026 06:29PM 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

27 Nov 2026 05:27PM UTC coverage: 84.555% (+0.002%) from 84.553%
46041987018

push

github

web-flow
Size the memory of empty DLPack tensors on oneAPI devices as one element (#3203)

This PR fixes the memory size that `dpnp.tensor.from_dlpack` and
`dpnp.from_dlpack` give an empty DLPack tensor with more than one
dimension on a oneAPI device.

`from_dlpack_capsule` sizes the memory of a tensor by the span from its
lowest to its highest element offset. A dimension of length 0 added
nothing to that span, but the other dimensions still did, so an empty
tensor of shape `(0, n)` was sized as `n` elements. With a NULL data
pointer, which DLPack asks for in a tensor of size zero and which #3197
made importable, that size is what gets allocated for the result: 4 MiB
for shape `(0, 2**20)` of `int32` and 8 GiB for `(0, 2**31)`. With a
data pointer, the imported memory claimed more than the producer
allocated: 4 MiB for an empty `dpnp.tensor` array of shape `(0, 2**20)`,
whose buffer is 4 bytes. A tensor with a dimension of length 0 now spans
no elements and gets one element, as `usm_ndarray` does for an empty
shape.

Two tests are added. Importing an empty tensor with a NULL data pointer
must allocate one element, and importing an empty `dpnp.tensor` array
must not claim more memory than the array's buffer. Without the fix, all
five cases fail.

#3183 changes the same loop to accept NULL strides, so whichever of the
two PRs lands second needs a small rebase.

- [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 %.

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

30809 of 35535 relevant lines covered (86.7%)

39399.37 hits per line

Jobs
ID Job ID Ran Files Coverage
1 46041987018.1 27 Nov 2026 06:29PM UTC 274
84.55
GitHub Action Run
Source Files on build 46041987018
  • 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 #46041987018
  • 10d9d858 on github
  • Prev Build on master (#45357515667)
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