-
Notifications
You must be signed in to change notification settings - Fork 2
/
parallelloop.tex
107 lines (94 loc) · 2.39 KB
/
parallelloop.tex
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
\clause{Parallel loops}
\pnum
A
\defn{parallel loop}
is a
\tcode{for}
statement with loop qualifiers.
The grammar of the iteration statement (6.8.5, paragraph 1)
is modified to read:
\begin{bnf}
\nontermdef{iteration-statement}
\br
\terminal{while} \terminal{(} expression \terminal{)} statement
\br
\terminal{do} statement \terminal{while} \terminal{(} expression \terminal{)} \terminal{;}
\br
loop-qualifiers\opt{} \terminal{for} \terminal{(}
expression\opt{} \terminal{;}
expression\opt{} \terminal{;}
expression\opt{} \terminal{)} statement
\br
loop-qualifiers\opt{} \terminal{for} \terminal{(}
declaration
expression\opt{} \terminal{;}
expression\opt{} \terminal{)} statement
\end{bnf}
\begin{cpp}
The grammar of
\nonterminal{iteration-statement}
(6.5 [stmt.iter], paragraph 1)
is modified to read:
\begin{bnf}
\nontermdef{iteration-statement}
\br
\terminal{while} \terminal{(} expression \terminal{)} statement
\br
\terminal{do} statement \terminal{while} \terminal{(} expression \terminal{)} \terminal{;}
\br
loop-qualifiers\opt{} \terminal{for} \terminal{(}
for-init-statement
condition\opt{} \terminal{;}
expression\opt{} \terminal{)} statement
\br
loop-qualifiers\opt{} \terminal{for} \terminal{(}
for-range-declaration \terminal{:}
for-range-initializer \terminal{)} statement
\end{bnf}
\end{cpp}
\pnum
The following rules are added to the grammar:
\begin{bnf}
\nontermdef{loop-qualifiers}
\br
\terminal{_Task} qualifier-clauses\opt
\end{bnf}
\begin{bnf}
\nontermdef{qualifier-clauses}
\br
loop-parameters qualifier-clauses\opt
\br
reduction-capture qualifier-clauses\opt
\end{bnf}
\begin{bnf}
\nontermdef{loop-parameters}
\br
\terminal{_Options} \terminal{(} expression \terminal{)}
\end{bnf}
\pnum
A parallel loop is a counted loop,
and shall satisfy all the constraints of a counted loop.
\pnum
In a parallel loop with the
\tcode{_Task}
loop qualifier,
each iteration is
executed as a task, independent of
all other iterations of that execution of the loop.
At the end of the loop,
execution joins with all of these tasks.
\pnum
If loop parameters are specified as part of the loop qualifiers,
the contained expression shall have type
``pointer to \pfx{loop_params_t}'',
as defined in header
\tcode{<cplex.h>}.%
\footnote{DFEP:
This syntax for specifying tuning parameters for a loop
is a CPLEX invention.
}
\pnum
The
\defn{serialization}
of a parallel loop
is obtained by deleting the loop qualifiers from the loop.