forked from OpenMP/Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExamples_host_teams.tex
More file actions
28 lines (22 loc) · 1.24 KB
/
Examples_host_teams.tex
File metadata and controls
28 lines (22 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
\pagebreak
\section{\code{teams} Construct on Host}
\label{sec:host_teams}
%{\color{blue} ... } {\color{violet} ... }
Originally the \code{teams} construct was created for devices (such as GPUs)
for independent executions of a structured block by teams within a league (on SMs).
It was only available through offloading with the \code{target} construct,
and the execution of a \code{teams} region could only be directed to host
execution by various means such as \code{if} and \code{device} clauses,
and the \code{OMP\_TARGET\_OFFLOAD} environment variable.
In OpenMP 5.0 the \code{teams} construct was extended to enable the host
to execute a \code{teams} region (without an associated \code{target} construct),
with anticipation of further affinity and threading controls in future OpenMP releases.
%With additional affinity controls, a team could be
%assigned to execute on a socket or use only a specified number of threads.
In the example below the \code{teams} construct is used to create two
teams, one to execute single precision code, and the other
to execute double precision code. Two teams are required, and
the thread limit for each team is set to 1/2 of the number of
available processors.
\cexample{host_teams}{1}
\ffreeexample{host_teams}{1}