Skip to content

Commit

Permalink
Add Device.persistent_unique_id
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Feb 18, 2014
1 parent d04f9c3 commit 723f19a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pyopencl/__init__.py
Expand Up @@ -350,8 +350,14 @@ def device_repr(self):
return "<pyopencl.Device '%s' on '%s' at 0x%x>" % (
self.name.strip(), self.platform.name.strip(), self.int_ptr)

def device_persistent_unique_id(self):
return (self.vendor, self.vendor_id, self.name, self.version)

Device.__repr__ = device_repr

# undocumented for now:
Device.persistent_unique_id = property(device_persistent_unique_id)

# }}}

# {{{ Context
Expand Down

0 comments on commit 723f19a

Please sign in to comment.