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
7db02782
Commit
7db02782
authored
Oct 14, 2015
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More non-determanism fixes.
parent
64a34cf2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
10 deletions
+16
-10
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+1
-1
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+2
-2
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+7
-7
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+6
-0
No files found.
Cython/Compiler/Code.py
View file @
7db02782
...
@@ -1324,7 +1324,7 @@ class GlobalState(object):
...
@@ -1324,7 +1324,7 @@ class GlobalState(object):
for
py_string
in
c
.
py_strings
.
values
():
for
py_string
in
c
.
py_strings
.
values
():
py_strings
.
append
((
c
.
cname
,
len
(
py_string
.
cname
),
py_string
))
py_strings
.
append
((
c
.
cname
,
len
(
py_string
.
cname
),
py_string
))
for
c
,
cname
in
s
elf
.
pyunicode_ptr_const_index
.
items
(
):
for
c
,
cname
in
s
orted
(
self
.
pyunicode_ptr_const_index
.
items
()
):
utf16_array
,
utf32_array
=
StringEncoding
.
encode_pyunicode_string
(
c
)
utf16_array
,
utf32_array
=
StringEncoding
.
encode_pyunicode_string
(
c
)
if
utf16_array
:
if
utf16_array
:
# Narrow and wide representations differ
# Narrow and wide representations differ
...
...
Cython/Compiler/ModuleNode.py
View file @
7db02782
...
@@ -1987,7 +1987,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -1987,7 +1987,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
def
create_import_star_conversion_utility_code
(
self
,
env
):
def
create_import_star_conversion_utility_code
(
self
,
env
):
# Create all conversion helpers that are needed for "import *" assignments.
# Create all conversion helpers that are needed for "import *" assignments.
# Must be done before code generation to support CythonUtilityCode.
# Must be done before code generation to support CythonUtilityCode.
for
name
,
entry
in
env
.
entries
.
items
(
):
for
name
,
entry
in
sorted
(
env
.
entries
.
items
()
):
if
entry
.
is_cglobal
and
entry
.
used
:
if
entry
.
is_cglobal
and
entry
.
used
:
if
not
entry
.
type
.
is_pyobject
:
if
not
entry
.
type
.
is_pyobject
:
entry
.
type
.
create_from_py_utility_code
(
env
)
entry
.
type
.
create_from_py_utility_code
(
env
)
...
@@ -2016,7 +2016,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -2016,7 +2016,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
old_error_label
=
code
.
new_error_label
()
old_error_label
=
code
.
new_error_label
()
code
.
putln
(
"if (0);"
)
# so the first one can be "else if"
code
.
putln
(
"if (0);"
)
# so the first one can be "else if"
for
name
,
entry
in
env
.
entries
.
items
(
):
for
name
,
entry
in
sorted
(
env
.
entries
.
items
()
):
if
entry
.
is_cglobal
and
entry
.
used
:
if
entry
.
is_cglobal
and
entry
.
used
:
code
.
putln
(
'else if (__Pyx_StrEq(name, "%s")) {'
%
name
)
code
.
putln
(
'else if (__Pyx_StrEq(name, "%s")) {'
%
name
)
if
entry
.
type
.
is_pyobject
:
if
entry
.
type
.
is_pyobject
:
...
...
Cython/Compiler/Nodes.py
View file @
7db02782
...
@@ -7832,7 +7832,7 @@ class ParallelStatNode(StatNode, ParallelNode):
...
@@ -7832,7 +7832,7 @@ class ParallelStatNode(StatNode, ParallelNode):
def
initialize_privates_to_nan
(
self
,
code
,
exclude
=
None
):
def
initialize_privates_to_nan
(
self
,
code
,
exclude
=
None
):
first
=
True
first
=
True
for
entry
,
(
op
,
lastprivate
)
in
s
elf
.
privates
.
items
(
):
for
entry
,
(
op
,
lastprivate
)
in
s
orted
(
self
.
privates
.
items
()
):
if
not
op
and
(
not
exclude
or
entry
!=
exclude
):
if
not
op
and
(
not
exclude
or
entry
!=
exclude
):
invalid_value
=
entry
.
type
.
invalid_value
()
invalid_value
=
entry
.
type
.
invalid_value
()
...
@@ -7874,7 +7874,7 @@ class ParallelStatNode(StatNode, ParallelNode):
...
@@ -7874,7 +7874,7 @@ class ParallelStatNode(StatNode, ParallelNode):
"""
"""
self
.
modified_entries
=
[]
self
.
modified_entries
=
[]
for
entry
in
s
elf
.
assignments
:
for
entry
in
s
orted
(
self
.
assignments
)
:
if
entry
.
from_closure
or
entry
.
in_closure
:
if
entry
.
from_closure
or
entry
.
in_closure
:
self
.
_allocate_closure_temp
(
code
,
entry
)
self
.
_allocate_closure_temp
(
code
,
entry
)
...
@@ -7899,7 +7899,7 @@ class ParallelStatNode(StatNode, ParallelNode):
...
@@ -7899,7 +7899,7 @@ class ParallelStatNode(StatNode, ParallelNode):
self
.
temps
=
temps
=
code
.
funcstate
.
stop_collecting_temps
()
self
.
temps
=
temps
=
code
.
funcstate
.
stop_collecting_temps
()
privates
,
firstprivates
=
[],
[]
privates
,
firstprivates
=
[],
[]
for
temp
,
type
in
temps
:
for
temp
,
type
in
sorted
(
temps
)
:
if
type
.
is_pyobject
or
type
.
is_memoryviewslice
:
if
type
.
is_pyobject
or
type
.
is_memoryviewslice
:
firstprivates
.
append
(
temp
)
firstprivates
.
append
(
temp
)
else
:
else
:
...
@@ -7922,7 +7922,7 @@ class ParallelStatNode(StatNode, ParallelNode):
...
@@ -7922,7 +7922,7 @@ class ParallelStatNode(StatNode, ParallelNode):
# Now clean up any memoryview slice and object temporaries
# Now clean up any memoryview slice and object temporaries
if
self
.
is_parallel
and
not
self
.
is_nested_prange
:
if
self
.
is_parallel
and
not
self
.
is_nested_prange
:
code
.
putln
(
"/* Clean up any temporaries */"
)
code
.
putln
(
"/* Clean up any temporaries */"
)
for
temp
,
type
in
s
elf
.
temps
:
for
temp
,
type
in
s
orted
(
self
.
temps
)
:
if
type
.
is_memoryviewslice
:
if
type
.
is_memoryviewslice
:
code
.
put_xdecref_memoryviewslice
(
temp
,
have_gil
=
False
)
code
.
put_xdecref_memoryviewslice
(
temp
,
have_gil
=
False
)
elif
type
.
is_pyobject
:
elif
type
.
is_pyobject
:
...
@@ -8094,7 +8094,7 @@ class ParallelStatNode(StatNode, ParallelNode):
...
@@ -8094,7 +8094,7 @@ class ParallelStatNode(StatNode, ParallelNode):
c
=
self
.
begin_of_parallel_control_block_point
c
=
self
.
begin_of_parallel_control_block_point
temp_count
=
0
temp_count
=
0
for
entry
,
(
op
,
lastprivate
)
in
s
elf
.
privates
.
items
(
):
for
entry
,
(
op
,
lastprivate
)
in
s
orted
(
self
.
privates
.
items
()
):
if
not
lastprivate
or
entry
.
type
.
is_pyobject
:
if
not
lastprivate
or
entry
.
type
.
is_pyobject
:
continue
continue
...
@@ -8303,7 +8303,7 @@ class ParallelWithBlockNode(ParallelStatNode):
...
@@ -8303,7 +8303,7 @@ class ParallelWithBlockNode(ParallelStatNode):
if
self
.
privates
:
if
self
.
privates
:
privates
=
[
e
.
cname
for
e
in
self
.
privates
privates
=
[
e
.
cname
for
e
in
self
.
privates
if
not
e
.
type
.
is_pyobject
]
if
not
e
.
type
.
is_pyobject
]
code
.
put
(
'private(%s)'
%
', '
.
join
(
privates
))
code
.
put
(
'private(%s)'
%
', '
.
join
(
sorted
(
privates
)
))
self
.
privatization_insertion_point
=
code
.
insertion_point
()
self
.
privatization_insertion_point
=
code
.
insertion_point
()
self
.
put_num_threads
(
code
)
self
.
put_num_threads
(
code
)
...
@@ -8623,7 +8623,7 @@ class ParallelRangeNode(ParallelStatNode):
...
@@ -8623,7 +8623,7 @@ class ParallelRangeNode(ParallelStatNode):
code
.
putln
(
"#ifdef _OPENMP"
)
code
.
putln
(
"#ifdef _OPENMP"
)
code
.
put
(
"#pragma omp for"
)
code
.
put
(
"#pragma omp for"
)
for
entry
,
(
op
,
lastprivate
)
in
s
elf
.
privates
.
items
(
):
for
entry
,
(
op
,
lastprivate
)
in
s
orted
(
self
.
privates
.
items
()
):
# Don't declare the index variable as a reduction
# Don't declare the index variable as a reduction
if
op
and
op
in
"+*-&^|"
and
entry
!=
self
.
target
.
entry
:
if
op
and
op
in
"+*-&^|"
and
entry
!=
self
.
target
.
entry
:
if
entry
.
type
.
is_pyobject
:
if
entry
.
type
.
is_pyobject
:
...
...
Cython/Compiler/Symtab.py
View file @
7db02782
...
@@ -223,6 +223,12 @@ class Entry(object):
...
@@ -223,6 +223,12 @@ class Entry(object):
def
all_entries
(
self
):
def
all_entries
(
self
):
return
[
self
]
+
self
.
inner_entries
return
[
self
]
+
self
.
inner_entries
def
__lt__
(
left
,
right
):
if
isinstance
(
left
,
Entry
)
and
isinstance
(
right
,
Entry
):
return
(
left
.
name
,
left
.
cname
)
<
(
right
.
name
,
right
.
cname
)
else
:
return
NotImplemented
class
InnerEntry
(
Entry
):
class
InnerEntry
(
Entry
):
"""
"""
...
...
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