Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
nexedi
cython
Commits
ebbc5f90
Unverified
Commit
ebbc5f90
authored
May 15, 2020
by
da-woods
Committed by
GitHub
May 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run ParallelRangeTransform also recursively on function arguments (GH-3608)
parent
fb09adfb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+1
-0
parallel.pyx
tests/run/parallel.pyx
+6
-0
No files found.
Cython/Compiler/ParseTreeTransforms.py
View file @
ebbc5f90
...
...
@@ -1190,6 +1190,7 @@ class ParallelRangeTransform(CythonTransform, SkipDeclarations):
def
visit_CallNode
(
self
,
node
):
self
.
visit
(
node
.
function
)
if
not
self
.
parallel_directive
:
self
.
visitchildren
(
node
,
exclude
=
(
'function'
,))
return
node
# We are a parallel directive, replace this node with the
...
...
tests/run/parallel.pyx
View file @
ebbc5f90
...
...
@@ -8,6 +8,9 @@ from libc.stdlib cimport malloc, free
openmp.omp_set_nested(1)
cdef int forward(int x) nogil:
return x
def test_parallel():
"""
>>> test_parallel()
...
...
@@ -20,6 +23,9 @@ def test_parallel():
with nogil, cython.parallel.parallel():
buf[threadid()] = threadid()
# Recognise threadid() also when it's used in a function argument.
# See https://github.com/cython/cython/issues/3594
buf[forward(cython.parallel.threadid())] = forward(threadid())
for i in range(maxthreads):
assert buf[i] == i
...
...
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