142 #pragma omp single nowait
147 int t = omp_get_thread_num();
154 int th = omp_get_thread_num();
155 printf(
"signalled independent task 9_%d, th %d started....\n", t, th);
160 #pragma omp atomic read
165 printf(
"signalled independent task 9_%d, th %d finished....\n", t, th);
167 #pragma omp task depend(in: i1, i2)
170 #pragma omp atomic capture
172 th = omp_get_thread_num();
173 printf(
"task 0_%d, th %d, checker %d\n", t, th, lcheck);
174 if (lcheck > 2 || lcheck < 1) {
176 printf(
"Error1, checker %d, not 1 or 2\n", lcheck);
179 #pragma omp atomic read
181 if (lcheck > 2 || lcheck < 1) {
184 printf(
"Error2, checker %d, not 1 or 2\n", lcheck);
189 #pragma omp task depend(in: i1, i2)
192 #pragma omp atomic capture
194 th = omp_get_thread_num();
195 printf(
"task 1_%d, th %d, checker %d\n", t, th, lcheck);
196 if (lcheck > 2 || lcheck < 1) {
198 printf(
"Error3, checker %d, not 1 or 2\n", lcheck);
201 #pragma omp atomic read
203 if (lcheck > 2 || lcheck < 1) {
205 printf(
"Error4, checker %d, not 1 or 2\n", lcheck);
213 sdep[0].
addr = (size_t)&i1;
216 sdep[1].
addr = (size_t)&i2;
224 sdep[0].
addr = (size_t)&i1;
233 #pragma omp task depend(in: i1, i2)
236 #pragma omp atomic capture
238 th = omp_get_thread_num();
239 printf(
"task 4_%d, th %d, checker %d\n", t, th, lcheck);
240 if (lcheck > 2 || lcheck < 1) {
242 printf(
"Error5, checker %d, not 1 or 2\n", lcheck);
245 #pragma omp atomic read
247 if (lcheck > 2 || lcheck < 1) {
249 printf(
"Error6, checker %d, not 1 or 2\n", lcheck);
254 #pragma omp task depend(in: i1, i2)
257 #pragma omp atomic capture
259 th = omp_get_thread_num();
260 printf(
"task 5_%d, th %d, checker %d\n", t, th, lcheck);
261 if (lcheck > 2 || lcheck < 1) {
263 printf(
"Error7, checker %d, not 1 or 2\n", lcheck);
266 #pragma omp atomic read
268 if (lcheck > 2 || lcheck < 1) {
270 printf(
"Error8, checker %d, not 1 or 2\n", lcheck);
278 sdep[0].
addr = (size_t)(-1);
289 sdep[1].
addr = (size_t)&i3;
295 #pragma omp task depend(in: i3)
298 #pragma omp atomic capture
300 th = omp_get_thread_num();
301 printf(
"task 8_%d, th %d, checker %d\n", t, th, lcheck);
304 printf(
"Error9, checker %d, != 1\n", lcheck);
307 #pragma omp atomic read
311 printf(
"Error10, checker %d, != 1\n", lcheck);
318 printf(
"all 10 tasks generated;\n"
319 "taskwait depend(omp_all_memory: out) started, th %d\n", t);
321 #pragma omp atomic write
323 printf(
"taskwait depend(omp_all_memory: out) passed, th %d\n", t);
331 printf(
"failed, err = %d, checker = %d\n",
err,
checker);
int __kmpc_omp_task_with_deps(id *loc, int gtid, task_t *task, int ndeps, dep *dep_lst, int nd_noalias, dep *noalias_lst)
void __kmpc_omp_wait_deps(id *loc, int gtid, int ndeps, dep *dep_lst, int ndeps_noalias, dep *noalias_dep_lst)
task_t * __kmpc_omp_task_alloc(id *loc, int gtid, int flags, size_t sz, size_t shar, entry_t rtn)