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
Gwenaël Samain
cython
Commits
c32b4056
Commit
c32b4056
authored
Jun 21, 2018
by
gabrieldemarmiesse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved the cimport openmp example out of the rst to put it in the examples directory.
parent
04780910
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
docs/examples/userguide/parallelism/cimport_openmp.pyx
docs/examples/userguide/parallelism/cimport_openmp.pyx
+9
-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 @
c32b4056
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 @
c32b4056
...
...
@@ -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
...
...
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