1 // REQUIRES: ompx_taskgraph
2 // RUN: %libomp-cxx-compile-and-run
9 // Compiler-generated code (emulation)
10 typedef struct ident
{
17 int __kmpc_global_thread_num(ident_t
*);
18 int __kmpc_start_record_task(ident_t
*, int, int, int);
19 void __kmpc_end_record_task(ident_t
*, int, int , int);
34 // no atomicity needed, can only be executed by 1 thread
35 // and no concurrency with other tasks possible
44 for (int iter
= 0; iter
< NT
; ++iter
) {
45 int gtid
= __kmpc_global_thread_num(nullptr);
46 int res
= __kmpc_start_record_task(nullptr, gtid
, /* kmp_tdg_flags */ 0, /* tdg_id */0);
49 #pragma omp task depend(out:y)
51 #pragma omp task depend(out:x)
53 #pragma omp task depend(in:x,y)
56 __kmpc_end_record_task(nullptr, gtid
, /* kmp_tdg_flags */0, /* tdg_id */0);
57 res
= __kmpc_start_record_task(nullptr, gtid
, /* kmp_tdg_flags */ 0, /* tdg_id */1);
60 #pragma omp task depend(out:y)
62 #pragma omp task depend(out:x)
64 #pragma omp task depend(in:x,y)
67 __kmpc_end_record_task(nullptr, gtid
, /* kmp_tdg_flags */0, /* tdg_id */1);
73 std::cout
<< "Passed" << std::endl
;