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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
8dbc7c39
Commit
8dbc7c39
authored
May 06, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cast invalid pointer initialisation values also for OpenMP temps and not just normal variables
Closes #1664
parent
5b401954
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+1
-1
tests/run/sequential_parallel.pyx
tests/run/sequential_parallel.pyx
+17
-0
No files found.
Cython/Compiler/Nodes.py
View file @
8dbc7c39
...
...
@@ -8076,7 +8076,7 @@ class ParallelStatNode(StatNode, ParallelNode):
invalid_value
=
entry
.
type
.
invalid_value
()
if
invalid_value
:
init
=
' = '
+
invalid_value
init
=
' = '
+
entry
.
type
.
cast_code
(
invalid_value
)
else
:
init
=
''
# Declare the parallel private in the outer block
...
...
tests/run/sequential_parallel.pyx
View file @
8dbc7c39
...
...
@@ -2,6 +2,7 @@
cimport
cython.parallel
from
cython.parallel
import
prange
,
threadid
from
cython.view
cimport
array
from
libc.stdlib
cimport
malloc
,
calloc
,
free
,
abort
from
libc.stdio
cimport
puts
...
...
@@ -737,3 +738,19 @@ def test_clean_temps():
except
Exception
,
e
:
print
e
.
args
[
0
]
def
test_pointer_temps
(
double
x
):
"""
>>> test_pointer_temps(1.0)
4.0
"""
cdef
Py_ssize_t
i
cdef
double
*
f
cdef
double
[:]
arr
=
array
(
format
=
"d"
,
shape
=
(
10
,),
itemsize
=
sizeof
(
double
))
arr
[
0
]
=
4.0
arr
[
1
]
=
3.0
for
i
in
prange
(
10
,
nogil
=
True
,
num_threads
=
1
):
f
=
&
arr
[
0
]
return
f
[
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