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

numba.typed.List fails for F-contiguous np.ndarrays if one is also C-contiguous #9588

Open
qrmt opened this issue May 27, 2024 · 1 comment
Labels
bug - ice Bugs: internal compiler error

Comments

@qrmt
Copy link

qrmt commented May 27, 2024

Issue description

Numpy array can be both C- and F-contiguous simultaneously, e.g. if 2D array only has one column.

If numba.typed.List is initialized with a list of F-contiguous numpy arrays, some of which are only F-contiguous and some of which are both C- and F-contiguous, an exception is raised for missing implementation.

Version: 0.59.1

Reproduction

import numba
import numpy as  np

arr1 = np.zeros((10,10), order='F')
arr2 = np.zeros((10,1), order='F')

print(arr1.flags['F_CONTIGUOUS'], arr2.flags['F_CONTIGUOUS']) # True, True
print(arr1.flags['C_CONTIGUOUS'], arr2.flags['C_CONTIGUOUS']) # False, True

numba.typed.List([arr1, arr2]) 

Exception raised:

No implementation of function Function(<function impl_append at 0x1052c1630>) found for signature:
 >>> impl_append(ListType[array(float64, 2d, F)], array(float64, 2d, C))
@sklam
Copy link
Member

sklam commented May 28, 2024

Hm... assertion check that I added (#2668) does not look right

@sklam sklam added the bug - ice Bugs: internal compiler error label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug - ice Bugs: internal compiler error
Projects
None yet
Development

No branches or pull requests

2 participants