From b9f467e863793fda5cc049b9947000c6b7a44df7 Mon Sep 17 00:00:00 2001 From: "[6~" Date: Tue, 28 Jan 2020 19:02:11 -0600 Subject: [PATCH] Use pyopencl.Device.hashable_model_and_version_id instead of persistent_unique_id --- loopy/target/pyopencl.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/loopy/target/pyopencl.py b/loopy/target/pyopencl.py index 826ba2a8f..4c27831e1 100644 --- a/loopy/target/pyopencl.py +++ b/loopy/target/pyopencl.py @@ -314,20 +314,21 @@ class PyOpenCLTarget(OpenCLTarget): if self.device is not None: assert other.device is not None - return (self.device.persistent_unique_id - == other.device.persistent_unique_id) + return (self.device.hashable_model_and_version_identifier + == other.device.hashable_model_and_version_identifier) else: assert other.device is None return True def update_persistent_hash(self, key_hash, key_builder): super(PyOpenCLTarget, self).update_persistent_hash(key_hash, key_builder) - key_builder.rec(key_hash, getattr(self.device, "persistent_unique_id", None)) + key_builder.rec(key_hash, getattr(self.device, + "hashable_model_and_version_identifier", None)) def __getstate__(self): dev_id = None if self.device is not None: - dev_id = self.device.persistent_unique_id + dev_id = self.device.hashable_model_and_version_identifier return { "device_id": dev_id, @@ -350,7 +351,7 @@ class PyOpenCLTarget(OpenCLTarget): dev for plat in cl.get_platforms() for dev in plat.get_devices() - if dev.persistent_unique_id == dev_id] + if dev.hashable_model_and_version_identifier == dev_id] if matches: self.device = matches[0] -- GitLab