Commit c32b4056 authored by gabrieldemarmiesse's avatar gabrieldemarmiesse

Moved the cimport openmp example out of the rst to put it in the examples directory.

parent 04780910
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()
# ...
......@@ -212,17 +212,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