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
81609c80
Commit
81609c80
authored
Feb 24, 2012
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue compiler warning for unsigned prange target (not allowed in omp < 3.0)
parent
30ba2ac1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
19 deletions
+24
-19
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+4
-0
tests/run/sequential_parallel.pyx
tests/run/sequential_parallel.pyx
+20
-19
No files found.
Cython/Compiler/Nodes.py
View file @
81609c80
...
...
@@ -7847,6 +7847,10 @@ class ParallelRangeNode(ParallelStatNode):
self
.
index_type
=
PyrexTypes
.
c_py_ssize_t_type
else
:
self
.
index_type
=
self
.
target
.
type
if
not
self
.
index_type
.
signed
:
warning
(
self
.
target
.
pos
,
"Unsigned index type not allowed before OpenMP 3.0"
,
level
=
2
)
# Setup start, stop and step, allocating temps if needed
self
.
names
=
'start'
,
'stop'
,
'step'
...
...
tests/run/sequential_parallel.pyx
View file @
81609c80
...
...
@@ -65,25 +65,26 @@ def test_propagation():
return
i
,
j
,
x
,
y
,
sum1
,
sum2
def
test_unsigned_operands
():
"""
>>> test_unsigned_operands()
10
"""
cdef
int
i
cdef
int
start
=
-
5
cdef
unsigned
int
stop
=
5
cdef
int
step
=
1
cdef
int
steps_taken
=
0
cdef
int
*
steps_takenp
=
&
steps_taken
for
i
in
prange
(
start
,
stop
,
step
,
nogil
=
True
):
steps_taken
+=
1
if
steps_takenp
[
0
]
>
10
:
abort
()
return
steps_taken
# DISABLED, not allowed in OpenMP 3.0 (fails on Windows)
#def test_unsigned_operands():
# """
# >>> test_unsigned_operands()
# 10
# """
# cdef int i
# cdef int start = -5
# cdef unsigned int stop = 5
# cdef int step = 1
#
# cdef int steps_taken = 0
# cdef int *steps_takenp = &steps_taken
#
# for i in prange(start, stop, step, nogil=True):
# steps_taken += 1
# if steps_takenp[0] > 10:
# abort()
#
# return steps_taken
def
test_reassign_start_stop_step
():
"""
...
...
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