Commit 0f85061
authored
cuda.core: fix _arr_is_c_contiguous discriminator for numba arrays (#1998)
`_arr_is_c_contiguous` checked `hasattr(arr, "flags")`, which is True
for both numpy arrays and numba `DeviceNDArray`. For numba `arr.flags`
is a plain dict, so the truthy branch falls into `arr.flags.c_contiguous`
and raises `AttributeError: 'dict' object has no attribute
'c_contiguous'`.
Discriminate on the flags object instead, mirroring the sibling
`_arr_is_writeable` helper. Unblocks six numba-cuda parametrizations:
- TestViewGPU::test_args_viewable_as_strided_memory_gpu[numba-cuda-{int8,float32}]
- TestViewGPU::test_strided_memory_view_cpu[numba-cuda-{int8,float32}]
- TestViewGPU::test_strided_memory_view_init[numba-cuda-{int8,float32}]
Made-with: Cursor1 parent aac5bf5 commit 0f85061
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| |||
0 commit comments