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.
I'm ramping up
.pyigeneration, 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
Indeed,
Bufferdoes not expose_sizeto Python (and_virtual_memory_resourceis Python, not Cython).It doesn't look like we have any test coverage for this file.
We probably need to make
Buffer.sizea read/write property.