Skip to content

[BUG]: StridedMemoryView.from_cuda_array_interface doesn't support zero-sized arrays #1396

@cpcloud

Description

@cpcloud

Is this a duplicate?

Type of Bug

Runtime Error

Component

cuda.core

Describe the bug

Calling StridedMemoryView.from_cuda_array_interface raises an exception when given a zero-sized array. StridedMemoryView.from_dlpack works.

How to Reproduce

import cupy as cp

from cuda.core.experimental.utils import StridedMemoryView

x = cp.zeros(0, dtype="int64")
StridedMemoryView.from_cuda_array_interface(x, stream_ptr=0)

Expected behavior

I would expect the behavior to be effective the same as StridedMemoryView.from_dlpack.

Operating System

No response

nvidia-smi output

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcuda.coreEverything related to the cuda.core module

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions