From d5f04a1e4a4641510d34a7d7136bae458a5b7af4 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sat, 22 Feb 2014 18:36:02 -0600 Subject: [PATCH] Use RecordWithoutPickling.register_fields after unpickling a loopy kernel --- loopy/kernel/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/loopy/kernel/__init__.py b/loopy/kernel/__init__.py index c70fffa07..4fa3e05ca 100644 --- a/loopy/kernel/__init__.py +++ b/loopy/kernel/__init__.py @@ -26,7 +26,7 @@ THE SOFTWARE. import numpy as np -from pytools import RecordWithoutPickling, memoize_method +from pytools import RecordWithoutPickling, Record, memoize_method import islpy as isl from islpy import dim_type import re @@ -765,7 +765,7 @@ class LoopKernel(RecordWithoutPickling): dom_intersect_assumptions, iname_idx) .coalesce()) - class BoundsRecord(RecordWithoutPickling): + class BoundsRecord(Record): pass size = (upper_bound_pw_aff - lower_bound_pw_aff + 1) @@ -1043,8 +1043,13 @@ class LoopKernel(RecordWithoutPickling): return result def __setstate__(self, state): + new_fields = set() + for k, v in state.iteritems(): setattr(self, k, v) + new_fields.add(k) + + self.register_fields(new_fields) from loopy.kernel.tools import SetOperationCacheManager self.cache_manager = SetOperationCacheManager() -- GitLab