Is this a duplicate?
Area
cuda.bindings
Is your feature request related to a problem? Please describe.
In cuda.bindings, seems nothing have __eq__ implemented, so == falls back to 'is'. If a user use something like 'cuda.bindings.runtime.cudaFree(0) == cuda.bindings.runtime.cudaError_t.cudaSuccess', he/she will always get False because of the comparison. While converting them to int before comparison works, it's very counter-intuitive.
Besides error code, other objects suffers from the same problem. For instance, if we call cuCtxGetCurrent() twice, we will get two different objects, and == will give False, even if the underlying C handle is the same.
Describe the solution you'd like
We need __eq__ for all resource handle objects.
Describe alternatives you've considered
No response
Additional context
No response
Is this a duplicate?
Area
cuda.bindings
Is your feature request related to a problem? Please describe.
In cuda.bindings, seems nothing have
__eq__implemented, so==falls back to 'is'. If a user use something like 'cuda.bindings.runtime.cudaFree(0) == cuda.bindings.runtime.cudaError_t.cudaSuccess', he/she will always get False because of the comparison. While converting them to int before comparison works, it's very counter-intuitive.Besides error code, other objects suffers from the same problem. For instance, if we call cuCtxGetCurrent() twice, we will get two different objects, and == will give False, even if the underlying C handle is the same.
Describe the solution you'd like
We need
__eq__for all resource handle objects.Describe alternatives you've considered
No response
Additional context
No response