[Openmp-commits] [openmp] Draft: Update OpenMP runtime to adopt taskgraph clause from 6.0 Specs (PR #130751)
Josep Pinot via Openmp-commits
openmp-commits at lists.llvm.org
Tue Mar 11 04:16:59 PDT 2025
https://github.com/jpinot updated https://github.com/llvm/llvm-project/pull/130751
>From c92b4c1ec5275e4b6a8d0a82abd67e514439e660 Mon Sep 17 00:00:00 2001
From: jpinot <josep.pinot at bsc.es>
Date: Mon, 10 Mar 2025 12:18:25 +0100
Subject: [PATCH 1/2] [wip][openmp] Fix taskgraph tdg_id to not function as an
idx
Tdg_id was implementatd as an idx, this implementation needs an
update in order to match the OpenMP spcs 6.0, were a graph_id
clause have been introduced. This MR assumes that the tdg_id is
generatd in LLVM CG and the runtime just gets a hashed id were
region/graph_id have taken into account.
This chenge is backwards compatible
---
openmp/runtime/src/kmp.h | 2 +
openmp/runtime/src/kmp_global.cpp | 2 +
openmp/runtime/src/kmp_tasking.cpp | 93 ++++++++++++++++++++++--------
3 files changed, 72 insertions(+), 25 deletions(-)
diff --git a/openmp/runtime/src/kmp.h b/openmp/runtime/src/kmp.h
index 36656325be4bd..a7748a6c58332 100644
--- a/openmp/runtime/src/kmp.h
+++ b/openmp/runtime/src/kmp.h
@@ -2647,10 +2647,12 @@ typedef struct kmp_tdg_info {
kmp_int32 rec_num_taskred;
} kmp_tdg_info_t;
+
extern int __kmp_tdg_dot;
extern kmp_int32 __kmp_max_tdgs;
extern kmp_tdg_info_t **__kmp_global_tdgs;
extern kmp_int32 __kmp_curr_tdg_idx;
+extern kmp_tdg_info_t* __kmp_curr_tdg;
extern kmp_int32 __kmp_successors_size;
extern std::atomic<kmp_int32> __kmp_tdg_task_id;
extern kmp_int32 __kmp_num_tdg;
diff --git a/openmp/runtime/src/kmp_global.cpp b/openmp/runtime/src/kmp_global.cpp
index 52e0fdbdfb1da..0bf5c034ad64a 100644
--- a/openmp/runtime/src/kmp_global.cpp
+++ b/openmp/runtime/src/kmp_global.cpp
@@ -556,6 +556,8 @@ kmp_int32 __kmp_max_tdgs = 100;
kmp_tdg_info_t **__kmp_global_tdgs = NULL;
kmp_int32 __kmp_curr_tdg_idx =
0; // Id of the current TDG being recorded or executed
+kmp_tdg_info_t* __kmp_curr_tdg =
+ NULL; // Current TDG being recorded or executed
kmp_int32 __kmp_num_tdg = 0;
kmp_int32 __kmp_successors_size = 10; // Initial succesor size list for
// recording
diff --git a/openmp/runtime/src/kmp_tasking.cpp b/openmp/runtime/src/kmp_tasking.cpp
index 3e229b517cfcd..42fe7c90c5ca7 100644
--- a/openmp/runtime/src/kmp_tasking.cpp
+++ b/openmp/runtime/src/kmp_tasking.cpp
@@ -1651,11 +1651,12 @@ kmp_task_t *__kmp_task_alloc(ident_t *loc_ref, kmp_int32 gtid,
}
#if OMPX_TASKGRAPH
- kmp_tdg_info_t *tdg = __kmp_find_tdg(__kmp_curr_tdg_idx);
+ /* kmp_tdg_info_t *tdg = __kmp_find_tdg(__kmp_curr_tdg_idx); */
+ kmp_tdg_info_t *tdg = __kmp_curr_tdg;
if (tdg && __kmp_tdg_is_recording(tdg->tdg_status) &&
(task_entry != (kmp_routine_entry_t)__kmp_taskloop_task)) {
taskdata->is_taskgraph = 1;
- taskdata->tdg = __kmp_global_tdgs[__kmp_curr_tdg_idx];
+ taskdata->tdg = __kmp_curr_tdg;
taskdata->td_task_id = KMP_ATOMIC_INC(&__kmp_tdg_task_id);
}
#endif
@@ -2576,13 +2577,13 @@ without help of the runtime library.
*/
void *__kmpc_task_reduction_init(int gtid, int num, void *data) {
#if OMPX_TASKGRAPH
- kmp_tdg_info_t *tdg = __kmp_find_tdg(__kmp_curr_tdg_idx);
+ kmp_tdg_info_t *tdg = __kmp_curr_tdg;
if (tdg && __kmp_tdg_is_recording(tdg->tdg_status)) {
- kmp_tdg_info_t *this_tdg = __kmp_global_tdgs[__kmp_curr_tdg_idx];
- this_tdg->rec_taskred_data =
+ /* kmp_tdg_info_t *this_tdg = __kmp_global_tdgs[__kmp_curr_tdg_idx]; */
+ tdg->rec_taskred_data =
__kmp_allocate(sizeof(kmp_task_red_input_t) * num);
- this_tdg->rec_num_taskred = num;
- KMP_MEMCPY(this_tdg->rec_taskred_data, data,
+ tdg->rec_num_taskred = num;
+ KMP_MEMCPY(tdg->rec_taskred_data, data,
sizeof(kmp_task_red_input_t) * num);
}
#endif
@@ -2603,13 +2604,13 @@ has two parameters, pointer to object to be initialized and pointer to omp_orig
*/
void *__kmpc_taskred_init(int gtid, int num, void *data) {
#if OMPX_TASKGRAPH
- kmp_tdg_info_t *tdg = __kmp_find_tdg(__kmp_curr_tdg_idx);
+ kmp_tdg_info_t *tdg = __kmp_curr_tdg;
if (tdg && __kmp_tdg_is_recording(tdg->tdg_status)) {
- kmp_tdg_info_t *this_tdg = __kmp_global_tdgs[__kmp_curr_tdg_idx];
- this_tdg->rec_taskred_data =
+ /* kmp_tdg_info_t *this_tdg = __kmp_global_tdgs[__kmp_curr_tdg_idx]; */
+ tdg->rec_taskred_data =
__kmp_allocate(sizeof(kmp_task_red_input_t) * num);
- this_tdg->rec_num_taskred = num;
- KMP_MEMCPY(this_tdg->rec_taskred_data, data,
+ tdg->rec_num_taskred = num;
+ KMP_MEMCPY(tdg->rec_taskred_data, data,
sizeof(kmp_task_red_input_t) * num);
}
#endif
@@ -2661,8 +2662,7 @@ void *__kmpc_task_reduction_get_th_data(int gtid, void *tskgrp, void *data) {
#if OMPX_TASKGRAPH
if ((thread->th.th_current_task->is_taskgraph) &&
- (!__kmp_tdg_is_recording(
- __kmp_global_tdgs[__kmp_curr_tdg_idx]->tdg_status))) {
+ (!__kmp_tdg_is_recording(__kmp_curr_tdg->tdg_status))) {
tg = thread->th.th_current_task->td_taskgroup;
KMP_ASSERT(tg != NULL);
KMP_ASSERT(tg->reduce_data != NULL);
@@ -5454,12 +5454,12 @@ bool __kmpc_omp_has_task_team(kmp_int32 gtid) {
#if OMPX_TASKGRAPH
// __kmp_find_tdg: identify a TDG through its ID
-// gtid: Global Thread ID
// tdg_id: ID of the TDG
// returns: If a TDG corresponding to this ID is found and not
// its initial state, return the pointer to it, otherwise nullptr
static kmp_tdg_info_t *__kmp_find_tdg(kmp_int32 tdg_id) {
kmp_tdg_info_t *res = nullptr;
+ kmp_int32 i = 0;
if (__kmp_max_tdgs == 0)
return res;
@@ -5467,9 +5467,45 @@ static kmp_tdg_info_t *__kmp_find_tdg(kmp_int32 tdg_id) {
__kmp_global_tdgs = (kmp_tdg_info_t **)__kmp_allocate(
sizeof(kmp_tdg_info_t *) * __kmp_max_tdgs);
- if ((__kmp_global_tdgs[tdg_id]) &&
- (__kmp_global_tdgs[tdg_id]->tdg_status != KMP_TDG_NONE))
- res = __kmp_global_tdgs[tdg_id];
+ for (i = 0; i < __kmp_max_tdgs; i++) {
+ if (__kmp_global_tdgs[i] &&
+ __kmp_global_tdgs[i]->tdg_id == tdg_id) {
+ if (__kmp_global_tdgs[i]->tdg_status != KMP_TDG_NONE) { //XXX: Do I really need this?
+ res = __kmp_global_tdgs[i];
+ }
+ // XXX: Probably cleanup if statue == KMP_TDG_NONE
+ break;
+ }
+ }
+ return res;
+}
+
+// __kmp_alloc_tdg: returns a new tdg TODO: complete message
+// tdg_id: ID of the TDG
+// returns: If a TDG corresponding to this ID is found and not
+// its initial state, return the pointer to it, otherwise nullptr
+static kmp_tdg_info_t *__kmp_alloc_tdg(kmp_int32 tdg_id) {
+ kmp_tdg_info_t *res = nullptr;
+ kmp_int32 i = 0;
+ if ((res = __kmp_find_tdg(tdg_id))) { // XXX: should I remove?
+ return res;
+ }
+ if (__kmp_num_tdg > __kmp_max_tdgs) {
+ return res;
+ }
+
+ for (i = 0; i < __kmp_max_tdgs; i++) {
+ if (!__kmp_global_tdgs[i]) {
+ kmp_tdg_info_t *tdg =
+ (kmp_tdg_info_t *)__kmp_allocate(sizeof(kmp_tdg_info_t));
+ __kmp_global_tdgs[i] = tdg;
+ __kmp_curr_tdg = tdg;
+ __kmp_curr_tdg_idx = i;
+ /* __kmp_num_tdg++; */
+ res = __kmp_global_tdgs[i];
+ break;
+ }
+ }
return res;
}
@@ -5507,7 +5543,7 @@ void __kmp_print_tdg_dot(kmp_tdg_info_t *tdg, kmp_int32 gtid) {
KA_TRACE(10, ("__kmp_print_tdg_dot(exit): T#%d tdg_id=%d \n", gtid, tdg_id));
}
-// __kmp_start_record: launch the execution of a previous
+// __kmp_exec_tdg: launch the execution of a previous
// recorded TDG
// gtid: Global Thread ID
// tdg: ID of the TDG
@@ -5567,9 +5603,13 @@ void __kmp_exec_tdg(kmp_int32 gtid, kmp_tdg_info_t *tdg) {
static inline void __kmp_start_record(kmp_int32 gtid,
kmp_taskgraph_flags_t *flags,
kmp_int32 tdg_id) {
- kmp_tdg_info_t *tdg =
- (kmp_tdg_info_t *)__kmp_allocate(sizeof(kmp_tdg_info_t));
- __kmp_global_tdgs[__kmp_curr_tdg_idx] = tdg;
+ kmp_tdg_info_t *tdg = __kmp_alloc_tdg(tdg_id);
+ /* kmp_tdg_info_t *tdg = */
+ /* (kmp_tdg_info_t *)__kmp_allocate(sizeof(kmp_tdg_info_t)); */
+ /* __kmp_global_tdgs[__kmp_num_tdg] = tdg; */
+ /* __kmp_curr_tdg = tdg; */
+ /* __kmp_num_tdg++; */
+ // TODO: separate to new method
// Initializing the TDG structure
tdg->tdg_id = tdg_id;
tdg->map_size = INIT_MAPSIZE;
@@ -5594,7 +5634,8 @@ static inline void __kmp_start_record(kmp_int32 gtid,
KMP_ATOMIC_ST_RLX(&this_record_map[i].npredecessors_counter, 0);
}
- __kmp_global_tdgs[__kmp_curr_tdg_idx]->record_map = this_record_map;
+ /* __kmp_global_tdgs[__kmp_curr_tdg_idx]->record_map = this_record_map; */
+ __kmp_curr_tdg->record_map = this_record_map;
}
// __kmpc_start_record_task: Wrapper around __kmp_start_record to mark
@@ -5624,12 +5665,14 @@ kmp_int32 __kmpc_start_record_task(ident_t *loc_ref, kmp_int32 gtid,
__kmpc_taskgroup(loc_ref, gtid);
if (kmp_tdg_info_t *tdg = __kmp_find_tdg(tdg_id)) {
+ printf("===> TDG exists\n");
// TODO: use re_record flag
__kmp_exec_tdg(gtid, tdg);
res = 0;
} else {
- __kmp_curr_tdg_idx = tdg_id;
- KMP_DEBUG_ASSERT(__kmp_curr_tdg_idx < __kmp_max_tdgs);
+ /* __kmp_curr_tdg_idx = tdg_id; */
+ /* __kmp_curr_tdg = tdg; */
+ /* KMP_DEBUG_ASSERT(__kmp_curr_tdg_idx < __kmp_max_tdgs); */
__kmp_start_record(gtid, flags, tdg_id);
__kmp_num_tdg++;
res = 1;
>From 50315e517685924af916008b5100162e18842e06 Mon Sep 17 00:00:00 2001
From: jpinot <josep.pinot at bsc.es>
Date: Tue, 11 Mar 2025 11:16:43 +0100
Subject: [PATCH 2/2] [wip][openmp] Add reset parameter to start_record_task
A new input parameter have been added to reset a taskgraph record
fllowing graph_reset cluase functionallity from OpenMP spcs 6.0,
This chenges are not backwards compatible due to a chenge on the
__kmpc_start_record_task input parameters.
---
openmp/runtime/src/kmp.h | 2 +-
openmp/runtime/src/kmp_tasking.cpp | 56 ++++++++++++++++---
.../test/tasking/omp_record_replay.cpp | 4 +-
.../test/tasking/omp_record_replay_deps.cpp | 4 +-
.../tasking/omp_record_replay_multiTDGs.cpp | 6 +-
.../tasking/omp_record_replay_print_dot.cpp | 4 +-
.../tasking/omp_record_replay_taskloop.cpp | 4 +-
7 files changed, 61 insertions(+), 19 deletions(-)
diff --git a/openmp/runtime/src/kmp.h b/openmp/runtime/src/kmp.h
index a7748a6c58332..77b519764ccf0 100644
--- a/openmp/runtime/src/kmp.h
+++ b/openmp/runtime/src/kmp.h
@@ -4386,7 +4386,7 @@ static inline bool __kmp_tdg_is_recording(kmp_tdg_status_t status) {
KMP_EXPORT kmp_int32 __kmpc_start_record_task(ident_t *loc, kmp_int32 gtid,
kmp_int32 input_flags,
- kmp_int32 tdg_id);
+ kmp_int32 tdg_id, bool reset);
KMP_EXPORT void __kmpc_end_record_task(ident_t *loc, kmp_int32 gtid,
kmp_int32 input_flags, kmp_int32 tdg_id);
#endif
diff --git a/openmp/runtime/src/kmp_tasking.cpp b/openmp/runtime/src/kmp_tasking.cpp
index 42fe7c90c5ca7..2415270ffabad 100644
--- a/openmp/runtime/src/kmp_tasking.cpp
+++ b/openmp/runtime/src/kmp_tasking.cpp
@@ -5509,6 +5509,42 @@ static kmp_tdg_info_t *__kmp_alloc_tdg(kmp_int32 tdg_id) {
return res;
}
+// __kmp_free_tdg: free a tdg if exists TODO: complete message
+// tdg_id: ID of the TDG
+// returns: If a TDG corresponding to this ID is found and not
+// its initial state, return the pointer to it, otherwise nullptr
+
+/* ==618292== definitely lost: 28,512 bytes in 99 blocks */
+/* ==618292== indirectly lost: 890,604 bytes in 5,148 blocks */
+/* ==618292== possibly lost: 13,046 bytes in 58 blocks */
+/* ==618292== still reachable: 1,944 bytes in 7 blocks */
+/* ==618292== suppressed: 0 bytes in 0 blocks */
+
+static bool __kmp_free_tdg(kmp_int32 tdg_id) {
+ kmp_tdg_info_t *tdg = nullptr;
+ kmp_int32 i = 0;
+ if (__kmp_global_tdgs == NULL)
+ return false;
+
+ for (i = 0; i < __kmp_max_tdgs; i++) {
+ if (__kmp_global_tdgs[i] &&
+ __kmp_global_tdgs[i]->tdg_id == tdg_id) {
+ tdg = __kmp_global_tdgs[i];
+ for (kmp_int i = 0; i < tdg->map_size; i++) {
+ __kmp_free(tdg->record_map[i].successors);
+ }
+ __kmp_free(tdg->record_map);
+ if (tdg->root_tasks)
+ __kmp_free(tdg->root_tasks);
+
+ __kmp_free(tdg);
+ __kmp_global_tdgs[i] = NULL;
+ return true;
+ }
+ }
+ return false;
+}
+
// __kmp_print_tdg_dot: prints the TDG to a dot file
// tdg: ID of the TDG
// gtid: Global Thread ID
@@ -5643,27 +5679,33 @@ static inline void __kmp_start_record(kmp_int32 gtid,
// loc_ref: Location of TDG, not used yet
// gtid: Global Thread ID of the encountering thread
// input_flags: Flags associated with the TDG
-// tdg_id: ID of the TDG to record, for now, incremental integer
+// tdg_id: ID of the TDG to record, XXX:
+// reset: Reset flag, XXX:
// returns: 1 if we record, otherwise, 0
kmp_int32 __kmpc_start_record_task(ident_t *loc_ref, kmp_int32 gtid,
- kmp_int32 input_flags, kmp_int32 tdg_id) {
+ kmp_int32 input_flags, kmp_int32 tdg_id,
+ bool reset) {
kmp_int32 res;
kmp_taskgraph_flags_t *flags = (kmp_taskgraph_flags_t *)&input_flags;
KA_TRACE(10,
- ("__kmpc_start_record_task(enter): T#%d loc=%p flags=%d tdg_id=%d\n",
- gtid, loc_ref, input_flags, tdg_id));
+ ("__kmpc_start_record_task(enter): T#%d loc=%p flags=%d tdg_id=%d\n "
+ "reset=%d\n", gtid, loc_ref, input_flags, tdg_id, reset));
if (__kmp_max_tdgs == 0) {
KA_TRACE(
10,
- ("__kmpc_start_record_task(abandon): T#%d loc=%p flags=%d tdg_id = %d, "
- "__kmp_max_tdgs = 0\n",
- gtid, loc_ref, input_flags, tdg_id));
+ ("__kmpc_start_record_task(abandon): T#%d loc=%p flags=%d "
+ "tdg_id = %d reset = %d, __kmp_max_tdgs = 0\n",
+ gtid, loc_ref, input_flags, tdg_id, reset));
return 1;
}
__kmpc_taskgroup(loc_ref, gtid);
+ if (reset) {
+ __kmp_free_tdg(tdg_id);
+ __kmp_num_tdg--;
+ }
if (kmp_tdg_info_t *tdg = __kmp_find_tdg(tdg_id)) {
printf("===> TDG exists\n");
// TODO: use re_record flag
diff --git a/openmp/runtime/test/tasking/omp_record_replay.cpp b/openmp/runtime/test/tasking/omp_record_replay.cpp
index 69ad98003a0d6..7779d27ca1788 100644
--- a/openmp/runtime/test/tasking/omp_record_replay.cpp
+++ b/openmp/runtime/test/tasking/omp_record_replay.cpp
@@ -13,7 +13,7 @@ typedef struct ident {
#ifdef __cplusplus
extern "C" {
int __kmpc_global_thread_num(ident_t *);
- int __kmpc_start_record_task(ident_t *, int, int, int);
+ int __kmpc_start_record_task(ident_t *, int, int, int, bool);
void __kmpc_end_record_task(ident_t *, int, int , int);
}
#endif
@@ -30,7 +30,7 @@ int main() {
#pragma omp single
for (int iter = 0; iter < NT; ++iter) {
int gtid = __kmpc_global_thread_num(nullptr);
- int res = __kmpc_start_record_task(nullptr, gtid, /* kmp_tdg_flags */ 0, /* tdg_id */0);
+ int res = __kmpc_start_record_task(nullptr, gtid, /* kmp_tdg_flags */ 0, /* tdg_id */0, /* reset */ false);
if (res) {
num_tasks++;
#pragma omp task
diff --git a/openmp/runtime/test/tasking/omp_record_replay_deps.cpp b/openmp/runtime/test/tasking/omp_record_replay_deps.cpp
index 9b6b370b30efc..05318e4e2cc08 100644
--- a/openmp/runtime/test/tasking/omp_record_replay_deps.cpp
+++ b/openmp/runtime/test/tasking/omp_record_replay_deps.cpp
@@ -16,7 +16,7 @@ typedef struct ident {
#ifdef __cplusplus
extern "C" {
int __kmpc_global_thread_num(ident_t *);
- int __kmpc_start_record_task(ident_t *, int, int, int);
+ int __kmpc_start_record_task(ident_t *, int, int, int, bool);
void __kmpc_end_record_task(ident_t *, int, int, int);
}
#endif
@@ -44,7 +44,7 @@ int main() {
#pragma omp single
for (int iter = 0; iter < NT; ++iter) {
int gtid = __kmpc_global_thread_num(nullptr);
- int res = __kmpc_start_record_task(nullptr, gtid, /* kmp_tdg_flags */0, /* tdg_id */0);
+ int res = __kmpc_start_record_task(nullptr, gtid, /* kmp_tdg_flags */0, /* tdg_id */0, /* reset */ false);
if (res) {
#pragma omp task depend(out:y)
add();
diff --git a/openmp/runtime/test/tasking/omp_record_replay_multiTDGs.cpp b/openmp/runtime/test/tasking/omp_record_replay_multiTDGs.cpp
index 03252843689c4..8edfa4e7ada84 100644
--- a/openmp/runtime/test/tasking/omp_record_replay_multiTDGs.cpp
+++ b/openmp/runtime/test/tasking/omp_record_replay_multiTDGs.cpp
@@ -15,7 +15,7 @@ int val;
#ifdef __cplusplus
extern "C" {
int __kmpc_global_thread_num(ident_t *);
- int __kmpc_start_record_task(ident_t *, int, int, int);
+ int __kmpc_start_record_task(ident_t *, int, int, int, bool);
void __kmpc_end_record_task(ident_t *, int, int , int);
}
#endif
@@ -43,7 +43,7 @@ int main() {
#pragma omp single
for (int iter = 0; iter < NT; ++iter) {
int gtid = __kmpc_global_thread_num(nullptr);
- int res = __kmpc_start_record_task(nullptr, gtid, /* kmp_tdg_flags */ 0, /* tdg_id */0);
+ int res = __kmpc_start_record_task(nullptr, gtid, /* kmp_tdg_flags */0, /* tdg_id */0, /* reset */ false);
if (res) {
num_tasks++;
#pragma omp task depend(out:y)
@@ -54,7 +54,7 @@ int main() {
mult();
}
__kmpc_end_record_task(nullptr, gtid, /* kmp_tdg_flags */0, /* tdg_id */0);
- res = __kmpc_start_record_task(nullptr, gtid, /* kmp_tdg_flags */ 0, /* tdg_id */1);
+ res = __kmpc_start_record_task(nullptr, gtid, /* kmp_tdg_flags */0, /* tdg_id */1, /* reset */ false);
if (res) {
num_tasks++;
#pragma omp task depend(out:y)
diff --git a/openmp/runtime/test/tasking/omp_record_replay_print_dot.cpp b/openmp/runtime/test/tasking/omp_record_replay_print_dot.cpp
index 2fe55f0815429..b32c42b659fa7 100644
--- a/openmp/runtime/test/tasking/omp_record_replay_print_dot.cpp
+++ b/openmp/runtime/test/tasking/omp_record_replay_print_dot.cpp
@@ -13,7 +13,7 @@ typedef struct ident {
#ifdef __cplusplus
extern "C" {
int __kmpc_global_thread_num(ident_t *);
- int __kmpc_start_record_task(ident_t *, int, int, int);
+ int __kmpc_start_record_task(ident_t *, int, int, int, bool);
void __kmpc_end_record_task(ident_t *, int, int , int);
}
#endif
@@ -48,7 +48,7 @@ int main() {
#pragma omp single
{
int gtid = __kmpc_global_thread_num(nullptr);
- int res = __kmpc_start_record_task(nullptr, gtid, /* kmp_tdg_flags */ 0, /* tdg_id */ 0);
+ int res = __kmpc_start_record_task(nullptr, gtid, /* kmp_tdg_flags */0, /* tdg_id */0, /* reset */ false);
if (res) {
#pragma omp task depend(out : x)
func(&num_exec);
diff --git a/openmp/runtime/test/tasking/omp_record_replay_taskloop.cpp b/openmp/runtime/test/tasking/omp_record_replay_taskloop.cpp
index 3d88faeeb28ee..2d50a9d41ac16 100644
--- a/openmp/runtime/test/tasking/omp_record_replay_taskloop.cpp
+++ b/openmp/runtime/test/tasking/omp_record_replay_taskloop.cpp
@@ -14,7 +14,7 @@ typedef struct ident {
#ifdef __cplusplus
extern "C" {
int __kmpc_global_thread_num(ident_t *);
- int __kmpc_start_record_task(ident_t *, int, int, int);
+ int __kmpc_start_record_task(ident_t *, int, int, int, bool);
void __kmpc_end_record_task(ident_t *, int, int , int);
}
#endif
@@ -31,7 +31,7 @@ int main() {
#pragma omp single
for (int iter = 0; iter < NT; ++iter) {
int gtid = __kmpc_global_thread_num(nullptr);
- int res = __kmpc_start_record_task(nullptr, gtid, /* kmp_tdg_flags */0, /* tdg_id */0);
+ int res = __kmpc_start_record_task(nullptr, gtid, /* kmp_tdg_flags */0, /* tdg_id */0, /* reset */ false);
if (res) {
num_tasks++;
#pragma omp taskloop reduction(+:sum) num_tasks(4096)
More information about the Openmp-commits
mailing list