Commit 323f6a47 authored by scoder's avatar scoder Committed by GitHub

Merge pull request #2392 from gabrieldemarmiesse/test_parallelism_3

Added tests to "Using Parallelism" part 3
parents 296a297b a109866d
# 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()
# ...
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment