LLVM OpenMP 20.0.0git
issue-50602.c
Go to the documentation of this file.
1// RUN: %libomp-compile-and-run
2// RUN: env OMP_NUM_THREADS=1 %libomp-run
3// RUN: %libomp-compile -DUSE_HIDDEN_HELPERS=1
4// RUN: %libomp-run
5// RUN: env OMP_NUM_THREADS=1 %libomp-run
6#include <omp.h>
7
8int main(int argc, char *argv[]) {
9 int i;
10
13
14 for (i = 0; i < 10; ++i) {
15#pragma omp parallel
16 {
17#ifndef USE_HIDDEN_HELPERS
18 omp_event_handle_t event;
19#endif
20 int a = 0;
21
22#ifdef USE_HIDDEN_HELPERS
23#pragma omp target map(tofrom : a) nowait
24#else
25#pragma omp task shared(a) detach(event)
26#endif
27 { a = 1; }
28
29#pragma omp parallel
30 { a = 2; }
31
32#ifndef USE_HIDDEN_HELPERS
33 omp_fulfill_event(event);
34#endif
35
36#pragma omp taskwait
37 }
38 }
39 return 0;
40}
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle __itt_metadata_type size_t void ITT_FORMAT p const __itt_domain __itt_id __itt_string_handle const wchar_t size_t ITT_FORMAT lu const __itt_domain __itt_id __itt_relation __itt_id ITT_FORMAT p const wchar_t int ITT_FORMAT __itt_group_mark d __itt_event event
#define i
Definition: kmp_stub.cpp:87
#define omp_set_max_active_levels
Definition: kmp_stub.cpp:29
#define omp_set_dynamic
Definition: kmp_stub.cpp:35
int a
int main()
Definition: test-touch.c:21