Is this a duplicate?
Area
cuda.core
Is your feature request related to a problem? Please describe.
Both cupy and pytorch define __hash__() methods which use the pointer address (and sometimes device index) of the underlying CUDA API structure such two Python level objects which represent the same underlying CUDA API structure will hash the same.
https://github.com/pytorch/pytorch/blob/v2.7.0/torch/cuda/streams.py#L14
https://github.com/cupy/cupy/blob/v13.4.1/cupy/cuda/stream.pyx
Describe the solution you'd like
cuda.core should also implement __hash__() such that caching and comparison are easier to implement.
Describe alternatives you've considered
No response
Additional context
No response
Is this a duplicate?
Area
cuda.core
Is your feature request related to a problem? Please describe.
Both cupy and pytorch define
__hash__()methods which use the pointer address (and sometimes device index) of the underlying CUDA API structure such two Python level objects which represent the same underlying CUDA API structure will hash the same.https://github.com/pytorch/pytorch/blob/v2.7.0/torch/cuda/streams.py#L14
https://github.com/cupy/cupy/blob/v13.4.1/cupy/cuda/stream.pyx
Describe the solution you'd like
cuda.core should also implement
__hash__()such that caching and comparison are easier to implement.Describe alternatives you've considered
No response
Additional context
No response