Skip to content

Bug in _grow_allocation_fast_path #2049

@mdboom

Description

@mdboom

I'm ramping up .pyi generation, which lead to type checking our code for the first time, and it's discovered a potential bug at this line:

https://github.com/NVIDIA/cuda-python/blob/main/cuda_core/cuda/core/_memory/_virtual_memory_resource.py#L338

cuda_core/cuda/core/_memory/_virtual_memory_resource.py:338: error: "Buffer" has no attribute "_size"; maybe "size"?

Indeed, Buffer does not expose _size to Python (and _virtual_memory_resource is Python, not Cython).

(Pdb) p buffer._size
*** AttributeError: 'cuda.core._memory._buffer.Buffer' object has no attribute '_size'. Did you mean: 'size'?
(Pdb) buffer._size = 42
*** AttributeError: 'cuda.core._memory._buffer.Buffer' object has no attribute '_size' and no __dict__ for setting new attributes. Did you mean: 'size'?

It doesn't look like we have any test coverage for this file.

We probably need to make Buffer.size a read/write property.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcuda.coreEverything related to the cuda.core moduletriageNeeds the team's attention

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions