LLVM OpenMP
20.0.0git
runtime
test
tasking
nested_task_creation.c
Go to the documentation of this file.
1
// RUN: %libomp-compile-and-run
2
#include <stdio.h>
3
#include <omp.h>
4
#include "
omp_my_sleep.h
"
5
6
/*
7
* This test creates tasks that themselves create a new task.
8
* The runtime has to take care that they are correctly freed.
9
*/
10
11
int
main
()
12
{
13
#pragma omp task
14
{
15
#pragma omp task
16
{
17
my_sleep
( 0.1 );
18
}
19
}
20
21
#pragma omp parallel num_threads(2)
22
{
23
#pragma omp single
24
#pragma omp task
25
{
26
#pragma omp task
27
{
28
my_sleep
( 0.1 );
29
}
30
}
31
}
32
33
printf(
"pass\n"
);
34
return
0;
35
}
main
int main()
Definition:
nested_task_creation.c:11
omp_my_sleep.h
my_sleep
static void my_sleep(double sleeptime)
Utility function to have a sleep function with better resolution and which only stops one thread.
Definition:
omp_my_sleep.h:24
Generated on Wed Feb 5 2025 10:57:21 for LLVM OpenMP by
1.9.6