Commit 4855fccb authored by Mark Florisson's avatar Mark Florisson

Make pyobject temps firstprivate

parent 3ddd9709
...@@ -6101,16 +6101,20 @@ class ParallelStatNode(StatNode, ParallelNode): ...@@ -6101,16 +6101,20 @@ class ParallelStatNode(StatNode, ParallelNode):
code.start_collecting_temps() should have been called. code.start_collecting_temps() should have been called.
""" """
if self.is_parallel: if self.is_parallel:
private_cnames = cython.set([e.cname for e in self.privates]) c = self.privatization_insertion_point
temps = [] temps = code.funcstate.stop_collecting_temps()
for cname, type in code.funcstate.stop_collecting_temps(): privates, firstprivates = [], []
if not type.is_pyobject: for temp, type in temps:
temps.append(cname) if type.is_pyobject:
firstprivates.append(temp)
else:
privates.append(temp)
c = self.privatization_insertion_point if privates:
if temps: c.put(" private(%s)" % ", ".join(privates))
c.put(" private(%s)" % ", ".join(temps)) if firstprivates:
c.put(" firstprivate(%s)" % ", ".join(firstprivates))
if self.breaking_label_used: if self.breaking_label_used:
shared_vars = [Naming.parallel_why] shared_vars = [Naming.parallel_why]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment