Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
2271a955
Commit
2271a955
authored
Feb 02, 2019
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '0.29.x'
parents
0ed473f9
a9154cf7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
5 deletions
+31
-5
CHANGES.rst
CHANGES.rst
+7
-0
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+8
-5
tests/run/sequential_parallel.pyx
tests/run/sequential_parallel.pyx
+16
-0
No files found.
CHANGES.rst
View file @
2271a955
...
...
@@ -92,6 +92,13 @@ Other changes
*
Support
for
Python
2.6
was
removed
.
0.29.5
(
2019
-??-??)
===================
*
Compiler
crash
when
`
prange
()`
loops
appear
inside
of
with
-
statements
.
(
Github
issue
#
2780
)
0.29.4
(
2019
-
02
-
01
)
===================
...
...
Cython/Compiler/Nodes.py
View file @
2271a955
...
...
@@ -8467,9 +8467,10 @@ class ParallelStatNode(StatNode, ParallelNode):
Make any used temporaries private. Before the relevant code block
code.start_collecting_temps() should have been called.
"""
if
self
.
is_parallel
:
c
=
self
.
privatization_insertion_point
c
=
self
.
privatization_insertion_point
self
.
privatization_insertion_point
=
None
if
self
.
is_parallel
:
self
.
temps
=
temps
=
code
.
funcstate
.
stop_collecting_temps
()
privates
,
firstprivates
=
[],
[]
for
temp
,
type
in
sorted
(
temps
):
...
...
@@ -8560,8 +8561,10 @@ class ParallelStatNode(StatNode, ParallelNode):
If compiled without OpenMP support (at the C level), then we still have
to acquire the GIL to decref any object temporaries.
"""
begin_code
=
self
.
begin_of_parallel_block
self
.
begin_of_parallel_block
=
None
if
self
.
error_label_used
:
begin_code
=
self
.
begin_of_parallel_block
end_code
=
code
begin_code
.
putln
(
"#ifdef _OPENMP"
)
...
...
@@ -8774,6 +8777,8 @@ class ParallelStatNode(StatNode, ParallelNode):
the for loop.
"""
c
=
self
.
begin_of_parallel_control_block_point
self
.
begin_of_parallel_control_block_point
=
None
self
.
begin_of_parallel_control_block_point_after_decls
=
None
# Firstly, always prefer errors over returning, continue or break
if
self
.
error_label_used
:
...
...
@@ -9124,8 +9129,6 @@ class ParallelRangeNode(ParallelStatNode):
self
.
setup_parallel_control_flow_block
(
code
)
# parallel control flow block
self
.
control_flow_var_code_point
=
code
.
insertion_point
()
# Note: nsteps is private in an outer scope if present
code
.
putln
(
"%(nsteps)s = (%(stop)s - %(start)s + %(step)s - %(step)s/abs(%(step)s)) / %(step)s;"
%
fmt_dict
)
...
...
tests/run/sequential_parallel.pyx
View file @
2271a955
...
...
@@ -754,3 +754,19 @@ def test_pointer_temps(double x):
f
=
&
arr
[
0
]
return
f
[
0
]
def
test_prange_in_with
(
int
x
,
ctx
):
"""
>>> from contextlib import contextmanager
>>> @contextmanager
... def ctx(l): yield l
>>> test_prange_in_with(4, ctx([0]))
6
"""
cdef
int
i
with
ctx
as
l
:
for
i
in
prange
(
x
,
nogil
=
True
):
with
gil
:
l
[
0
]
+=
i
return
l
[
0
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment