Skip to content

Commit

Permalink
Fix comparison of CL objects
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Aug 9, 2016
1 parent 44f011e commit 799ebdd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyopencl/cffi_cl.py
Expand Up @@ -222,7 +222,10 @@ def __del__(self):
_lib.clobj__delete(self.ptr)

def __eq__(self, other):
return other == self.int_ptr
return other.int_ptr == self.int_ptr

def __ne__(self, other):
return not self.__eq__(other)

def __hash__(self):
return _lib.clobj__int_ptr(self.ptr)
Expand Down

0 comments on commit 799ebdd

Please sign in to comment.