From 799ebdd196c29eef9feb623fb36e9a9f22a58931 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Tue, 9 Aug 2016 15:28:46 -0500
Subject: [PATCH] Fix comparison of CL objects

---
 pyopencl/cffi_cl.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pyopencl/cffi_cl.py b/pyopencl/cffi_cl.py
index fe1a07f9..2a2a120a 100644
--- a/pyopencl/cffi_cl.py
+++ b/pyopencl/cffi_cl.py
@@ -222,7 +222,10 @@ class _Common(object):
         _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)
-- 
GitLab