Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

numba-dpex doesn't support zero-length array creation #1192

Open
chudur-budur opened this issue Oct 27, 2023 · 0 comments
Open

numba-dpex doesn't support zero-length array creation #1192

chudur-budur opened this issue Oct 27, 2023 · 0 comments

Comments

@chudur-budur
Copy link
Contributor

chudur-budur commented Oct 27, 2023

If we look at dpnp and numpy, they support zero-length array creation (i.e. shape is 0)

>>> import numpy as np
>>> a = np.empty(0)
>>> a
array([], dtype=float64)
>>> import dpnp
>>> a = dpnp.empty(0)
>>> a
array([])

numba-dpex should do the same.

@dpjit
def foo():
    x = dpnp.empty(0)
    return x

a = foo()
print(a)

but it doesn't:

Traceback (most recent call last):
  File "/localdisk/work/$USER/numba-dpex/my-driver.py", line 20, in <module>
    a = bar()
MemoryError: USM allocation failed. Check the usm_type and queue.

This is applicable all other array creation functions, zeros(), ones(), etc.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant