cimport_openmp.pyx 291 Bytes
Newer Older
Stefan Behnel's avatar
Stefan Behnel committed
1 2 3 4 5 6 7 8 9 10 11 12 13
# 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()
    # ...