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
323f6a47
Commit
323f6a47
authored
Jun 22, 2018
by
scoder
Committed by
GitHub
Jun 22, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2392 from gabrieldemarmiesse/test_parallelism_3
Added tests to "Using Parallelism" part 3
parents
296a297b
a109866d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
10 deletions
+15
-10
docs/examples/userguide/parallelism/cimport_openmp.pyx
docs/examples/userguide/parallelism/cimport_openmp.pyx
+13
-0
docs/src/userguide/parallelism.rst
docs/src/userguide/parallelism.rst
+2
-10
No files found.
docs/examples/userguide/parallelism/cimport_openmp.pyx
0 → 100644
View file @
323f6a47
# tag: openmp
# You can ignore the previous line.
# It's for internal testing of the Cython documentation.
from
cython.parallel
cimport
parallel
cimport
openmp
cdef
int
num_threads
openmp
.
omp_set_dynamic
(
1
)
with
nogil
,
parallel
():
num_threads
=
openmp
.
omp_get_num_threads
()
# ...
docs/src/userguide/parallelism.rst
View file @
323f6a47
...
...
@@ -200,17 +200,9 @@ whether it will simply break or whether it will return 2.
Using OpenMP Functions
======================
OpenMP functions can be used by cimporting ``openmp``:
:
OpenMP functions can be used by cimporting ``openmp``:
from cython.parallel cimport parallel
cimport openmp
cdef int num_threads
openmp.omp_set_dynamic(1)
with nogil, parallel():
num_threads = openmp.omp_get_num_threads()
...
.. literalinclude:: ../../examples/userguide/parallelism/cimport_openmp.pyx
.. rubric:: References
...
...
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