blob: da2e99ee408f7b85f8c844f52dfcbc834d0abac5 (
plain)
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
|
// RUN: %libomp-compile
// RUN: env KMP_TASKING=0 %libomp-run
// RUN: env KMP_TASKING=1 %libomp-run
// RUN: env KMP_TASKING=2 %libomp-run
//
// Test to make sure the KMP_TASKING=1 option doesn't crash
// Can use KMP_TASKING=0 (immediate exec) or 2 (defer to task queue
// and steal during regular barrier) but cannot use
// KMP_TASKING=1 (explicit tasking barrier before regular barrier)
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
int main() {
int i;
#pragma omp parallel
{
#pragma omp single
{
for (i = 0; i < 10; i++) {
#pragma omp task
{
printf("Task %d executed by thread %d\n", i, omp_get_thread_num());
}
}
}
}
return EXIT_SUCCESS;
}
|