Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion python/cuda_cccl/cuda/compute/_cccl_interop.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,17 @@ def _numpy_type_to_info(numpy_type: np.dtype) -> TypeInfo:
def _device_array_to_cccl_iter(array: DeviceArrayLike) -> Iterator:
if not is_contiguous(array):
raise ValueError("Non-contiguous arrays are not supported.")
info = _numpy_type_to_info(get_dtype(array))
dtype = get_dtype(array)

# Handle structured dtypes by creating a proper gpu_struct
if dtype.type == np.void:
from .struct import gpu_struct

numba_type = as_numba_type(gpu_struct(dtype))
info = _numba_type_to_info(numba_type)
else:
info = _numpy_type_to_info(dtype)

state_info = _numpy_type_to_info(np.intp)
return Iterator(
state_info.alignment,
Expand Down
Loading