11OpenMP support
22==============
33
4- The following tables show supported OpenMP directives and the support status of
4+ OpenMP directives and clauses
5+ -----------------------------
6+
7+ The following section shows supported OpenMP directives and the support status of
58their clauses.
69
710.. note ::
@@ -10,103 +13,179 @@ their clauses.
1013 🔶 = partial support
1114
1215
13- .. csv-table ::
14-
15- ,
16- **barrier **,
16+ barrier
17+ ~~~~~~~
18+
19+ No clauses.
20+
21+ critical
22+ ~~~~~~~~
23+
24+ No clauses.
25+
26+ for
27+ ~~~
28+
29+ * ✅ collapse, firstprivate, lastprivate, private
30+ * 🔶 reduction
31+ * ❌ allocate, linear, nowait, order, ordered, schedule
32+
33+ parallel
34+ ~~~~~~~~
35+
36+ * ✅ default, firstprivate, if, num_threads, private, shared
37+ * 🔶 reduction
38+ * ❌ allocate, copyin, proc_bind
39+
40+ parallel for
41+ ~~~~~~~~~~~~
1742
18- .. csv-table ::
43+ Combines `` parallel `` and `` for `` directives. See clauses for ` for `_ and ` parallel `_ above.
1944
20- ,
21- ** critical **,
45+ single
46+ ~~~~~~
2247
23- .. csv-table ::
48+ * ❌ allocate, copyprivate, firstprivate, nowait, private
2449
25- ,allocate,collapse,firstprivate,lastprivate,linear,nowait,order,ordered,private,reduction,schedule
26- ** for **,❌,✅,✅,✅,❌,❌,❌,❌,✅,🔶,❌
50+ task
51+ ~~~~
2752
28- .. csv-table ::
29-
30- ,allocate,copyin,default,firstprivate,if,num_threads,private,proc_bind,reduction,shared
31- **parallel **,❌,❌,✅,✅,✅,✅,✅,❌,🔶,✅
53+ * ✅ default, firstprivate, private, shared
54+ * ❌ affinity, allocate, detach, if, in_reduction, final, mergeable, priority, untied
3255
33- .. csv-table ::
34-
35- ,*See clauses for* **parallel ** *and * **for ** directives
36- **parallel for **,
56+ taskwait
57+ ~~~~~~~~
3758
38- .. csv-table ::
59+ * ❌ depend, nowait
3960
40- ,allocate,copyprivate,firstprivate,nowait,private
41- ** single **,❌,❌,❌,❌,❌
61+ target
62+ ~~~~~~
4263
43- .. csv-table ::
64+ * ✅ device, firstprivate, map, private, thread_limit
65+ * ❌ allocate, defaultmap, depend, has_device_addr, if, in_reduction, is_device_ptr, nowait, uses_allocators
4466
45- ,affinity,allocate,default,detach,if,in_reduction,final,firstprivate,mergeable,priority,private,shared,untied
46- ** task **,❌,❌,✅,❌,❌,❌,❌,✅,❌,❌,✅,✅,❌
67+ teams
68+ ~~~~~
4769
48- .. csv-table ::
70+ * ✅ default, firstprivate, num_teams, private, shared, thread_limit
71+ * 🔶 reduction
4972
50- ,depend,nowait
51- ** taskwait **,❌,❌
73+ distribute
74+ ~~~~~~~~~~
5275
53- .. csv-table ::
76+ * ✅ firstprivate, lastprivate, private
77+ * ❌ allocate, collapse, dist_schedule, order
5478
55- ,allocate,defaultmap,depend,device,firstprivate,has_device_addr,if,in_reduction,is_device_ptr,map,nowait,private,thread_limit,uses_allocators
56- ** target **,❌,❌,❌,✅,✅,❌,❌,❌,❌,✅,❌,✅,✅,❌
79+ teams distribute
80+ ~~~~~~~~~~~~~~~~
5781
58- .. csv-table ::
82+ Combines `` teams `` and `` distribute `` directives. See clauses for ` teams `_ and ` distribute `_ above.
5983
60- ,private,firstprivate,shared,reduction,default,num_teams,thread_limit
61- ** teams **,✅,✅,✅,🔶,✅,✅,✅
84+ target teams
85+ ~~~~~~~~~~~~
6286
63- .. csv-table ::
87+ Combines `` target `` and `` teams `` directives. See clauses for ` target `_ and ` teams `_ above.
6488
65- ,allocate,collapse,dist_schedule,firstprivate,lastprivate,order,private
66- ** distribute **,❌,❌,❌,✅,✅,❌,✅
89+ target data
90+ ~~~~~~~~~~~
6791
68- .. csv-table ::
92+ * ✅ device, map
93+ * ❌ if, use_device_ptr, use_device_addr
6994
70- ,*See clauses for* ** teams ** * and * ** distribute ** directives
71- ** teams distribute **,
95+ target enter data
96+ ~~~~~~~~~~~~~~~~~
7297
73- .. csv-table ::
98+ * ✅ device, map
99+ * ❌ depend, if, nowait
74100
75- ,*See clauses for* ** teams ** * and * ** teams ** directives
76- ** target teams **,
101+ target exit data
102+ ~~~~~~~~~~~~~~~~
77103
104+ Same clauses as `target enter data `_. See above.
78105
79- .. csv-table ::
106+ target update
107+ ~~~~~~~~~~~~~
80108
81- ,device,if,map,use_device_ptr,use_device_addr
82- **target data **,✅,❌,✅,❌,❌
83-
84- .. csv-table ::
109+ * ✅ device, from, to
110+ * ❌ depend, if, nowait
85111
86- ,depend,device,if,map,nowait
87- ** target enter data **,❌,✅,❌,✅,❌
112+ target teams distribute
113+ ~~~~~~~~~~~~~~~~~~~~~~~
88114
89- .. csv-table ::
115+ Combines `` target ``, `` teams ``, and `` distribute `` directives. See clauses for ` target `_, ` teams `_, and ` distribute `_ above.
90116
91- ,*See clauses for the* ** target enter data ** directive
92- ** target exit data **,
117+ distribute parallel for
118+ ~~~~~~~~~~~~~~~~~~~~~~~
93119
94- .. csv-table ::
120+ Combines `` distribute `` and `` parallel for `` directives. See clauses for ` distribute `_, ` parallel `_, and ` for `_ above.
95121
96- ,nowait,depend,device,from,if,to
97- ** target update **,❌,❌,✅,✅,❌,✅
122+ target teams distribute parallel for
123+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
98124
99- .. csv-table ::
125+ Combines `` target ``, `` teams ``, `` distribute ``, and `` parallel for `` directives. See clauses for ` target `_, ` teams `_, ` parallel `_, and ` for `_ above.
100126
101- ,*See clauses for* **target ** *and * **teams distribute ** directives
102- **target teams distribute **,
103127
104- .. csv-table ::
128+ OpenMP runtime functions
129+ -------------------------
130+ **Thread and team information: **
105131
106- ,*See clauses for* **distribute ** *and * **parallel for ** directives
107- **distribute parallel for **,
132+ * ``omp_get_thread_num() `` - Returns the unique identifier of the calling thread
133+ * ``omp_get_num_threads() `` - Returns the total number of threads in the current parallel region
134+ * ``omp_set_num_threads(n) `` - Sets the number of threads for subsequent parallel regions
135+ * ``omp_get_max_threads() `` - Returns the maximum number of threads available
136+ * ``omp_get_num_procs() `` - Returns the number of processors in the system
137+ * ``omp_get_thread_limit() `` - Returns the thread limit for the parallel region
138+ * ``omp_in_parallel() `` - Returns 1 if called within a parallel region, 0 otherwise
139+ * ``omp_get_team_num() `` - Returns the team number in a target region
140+ * ``omp_get_num_teams() `` - Returns the number of teams in a target region
108141
109- .. csv-table ::
142+ ** Timing: **
110143
111- ,*See clauses for* **target ** *and * **teams ** *and * **distribute parallel for ** directives
112- **target teams distribute parallel for **,
144+ * ``omp_get_wtime() `` - Returns elapsed wall-clock time (useful for performance profiling)
145+
146+ **Nested and hierarchical parallelism: **
147+
148+ * ``omp_set_nested(flag) `` - Enables or disables nested parallelism
149+ * ``omp_set_dynamic(flag) `` - Enables or disables dynamic thread adjustment
150+ * ``omp_set_max_active_levels(n) `` - Sets the maximum number of nested parallel levels
151+ * ``omp_get_max_active_levels() `` - Returns the maximum number of nested parallel levels
152+ * ``omp_get_level() `` - Returns the current nesting level
153+ * ``omp_get_active_level() `` - Returns the current active nesting level
154+ * ``omp_get_ancestor_thread_num(level) `` - Returns the thread number at a given nesting level
155+ * ``omp_get_team_size(level) `` - Returns the team size at a given nesting level
156+ * ``omp_get_supported_active_levels() `` - Returns the supported number of nested active levels
157+
158+ **Advanced features: **
159+
160+ * ``omp_get_proc_bind() `` - Returns the processor binding policy
161+ * ``omp_get_num_places() `` - Returns the number of available places
162+ * ``omp_get_place_num_procs(place) `` - Returns the number of processors in a place
163+ * ``omp_get_place_num() `` - Returns the current place number
164+
165+ Supported features and platforms
166+ ---------------------------------
167+
168+ PyOMP builds on `Numba <https://numba.pydata.org/ >`_ Just-In-Time (JIT)
169+ compilation extensions to implement portable parallel execution using LLVM's
170+ OpenMP implementation.
171+
172+ OpenMP support
173+ ~~~~~~~~~~~~~~
174+
175+ PyOMP supports OpenMP features that are officially supported by the LLVM OpenMP
176+ runtime. The specific set of supported features depends on the version of the
177+ LLVM OpenMP runtime and the version of Numba you are using. As both LLVM and
178+ Numba evolve, support for additional OpenMP features may be added in future
179+ PyOMP releases. For detailed information about Numba and LLVM version
180+ compatibility, see the `Numba support info
181+ <https://numba.readthedocs.io/en/stable/user/installing.html#numba-support-info> `_
182+ in the Numba documentation.
183+
184+ GPU offloading support
185+ ~~~~~~~~~~~~~~~~~~~~~~
186+
187+ PyOMP supports GPU offloading exclusively for NVIDIA GPU architectures. The
188+ specific GPU architecture versions supported (e.g., compute capability levels)
189+ depend on the LLVM OpenMP runtime support in your environment. Consult the
190+ LLVM OpenMP documentation for your specific version to determine which NVIDIA
191+ GPU architectures are supported.
0 commit comments